Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

snabbdom

Package Overview
Dependencies
Maintainers
5
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snabbdom - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

7

build/package/modules/eventlisteners.d.ts

@@ -0,9 +1,10 @@

import { VNode } from '../vnode';
import { Module } from './module';
declare type SpecificListener<N extends keyof HTMLElementEventMap> = (ev: HTMLElementEventMap[N]) => void;
declare type Listener<T> = (this: VNode, ev: T, vnode: VNode) => void;
export declare type On = {
[N in keyof HTMLElementEventMap]?: SpecificListener<N> | Array<SpecificListener<N>>;
[N in keyof HTMLElementEventMap]?: Listener<HTMLElementEventMap[N]> | Array<Listener<HTMLElementEventMap[N]>>;
} & {
[event: string]: EventListener | EventListener[];
[event: string]: Listener<any> | Array<Listener<any>>;
};
export declare const eventListenersModule: Module;
export {};
function invokeHandler(handler, vnode, event) {
if (typeof handler === 'function') {
// call function handler
// @ts-expect-error
handler.call(vnode, event, vnode);

@@ -6,0 +5,0 @@ }

@@ -5,2 +5,10 @@ # Changelog

## [2.1.0](https://github.com/snabbdom/snabbdom/compare/v2.0.0...v2.1.0) (2020-09-14)
### Features
* **eventlisteners:** add types for VNode in listener ([63b1b6c](https://github.com/snabbdom/snabbdom/commit/63b1b6c22e49d06b1fb509a14d321ec19f324bb5)), closes [#796](https://github.com/snabbdom/snabbdom/issues/796)
* **eventlisteners:** relax custom event listener type ([15ce059](https://github.com/snabbdom/snabbdom/commit/15ce059e2b5e80d1975168fff2d2a44f71bd5cbb)), closes [#850](https://github.com/snabbdom/snabbdom/issues/850)
## [2.0.0](https://github.com/snabbdom/snabbdom/compare/v1.0.1...v2.0.0) (2020-09-10)

@@ -7,0 +15,0 @@

{
"name": "snabbdom",
"version": "2.0.0",
"version": "2.1.0",
"description": "A virtual DOM library with focus on simplicity, modularity, powerful features and performance.",

@@ -29,5 +29,5 @@ "type": "module",

"@babel/preset-env": "7.11.5",
"@commitlint/cli": "9.1.2",
"@commitlint/config-conventional": "9.1.2",
"@commitlint/travis-cli": "9.1.2",
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"@commitlint/travis-cli": "11.0.0",
"@types/chai": "4.2.12",

@@ -45,4 +45,4 @@ "@types/faker": "5.1.0",

"cross-env": "7.0.2",
"editorconfig-checker": "3.1.0",
"eslint": "7.8.1",
"editorconfig-checker": "3.2.0",
"eslint": "7.9.0",
"eslint-config-standard-with-typescript": "19.0.1",

@@ -64,3 +64,3 @@ "eslint-plugin-import": "2.22.0",

"karma-mocha-reporter": "2.2.5",
"latest-snabbdom-release": "npm:snabbdom@1.0.1",
"latest-snabbdom-release": "npm:snabbdom@2.0.0",
"lodash.shuffle": "4.2.0",

@@ -67,0 +67,0 @@ "mathjs": "7.2.0",

import { VNode, VNodeData } from '../vnode'
import { Module } from './module'
type SpecificListener<N extends keyof HTMLElementEventMap> = (ev: HTMLElementEventMap[N]) => void
type Listener<T> = (this: VNode, ev: T, vnode: VNode) => void
export type On = {
[N in keyof HTMLElementEventMap]?: SpecificListener<N> | Array<SpecificListener<N>>
[N in keyof HTMLElementEventMap]?: Listener<HTMLElementEventMap[N]> | Array<Listener<HTMLElementEventMap[N]>>
} & {
[event: string]: EventListener | EventListener[]
[event: string]: Listener<any> | Array<Listener<any>>
}
type SomeListener<N extends keyof HTMLElementEventMap> = SpecificListener<N> | EventListener
type SomeListener<N extends keyof HTMLElementEventMap> = Listener<HTMLElementEventMap[N]> | Listener<any>
function invokeHandler<N extends keyof HTMLElementEventMap> (handler: SomeListener<N> | Array<SomeListener<N>>, vnode?: VNode, event?: Event): void {
function invokeHandler<N extends keyof HTMLElementEventMap> (handler: SomeListener<N> | Array<SomeListener<N>>, vnode: VNode, event?: Event): void {
if (typeof handler === 'function') {
// call function handler
// @ts-expect-error
handler.call(vnode, event, vnode)

@@ -19,0 +18,0 @@ } else if (typeof handler === 'object') {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc