d3-dispatch
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -1,1 +0,1 @@ | ||
var version = "0.4.0"; export * from "../index"; export {version}; | ||
var version = "0.4.1"; export * from "../index"; export {version}; |
@@ -7,4 +7,4 @@ (function (global, factory) { | ||
var slice = Array.prototype.slice; | ||
var noop = {value: function() {}}; | ||
function dispatch() { | ||
@@ -60,3 +60,4 @@ for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { | ||
call: function(type, that) { | ||
this.apply(type, that, slice.call(arguments, 2)); | ||
if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n; i < n; ++i) args[i] = arguments[i + 2]; | ||
this.apply(type, that, args); | ||
}, | ||
@@ -88,3 +89,3 @@ apply: function(type, that, args) { | ||
var version = "0.4.0"; | ||
var version = "0.4.1"; | ||
@@ -91,0 +92,0 @@ exports.version = version; |
@@ -1,1 +0,1 @@ | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(n.d3_dispatch={})}(this,function(n){"use strict";function e(){for(var n,e=0,r=arguments.length,i={};r>e;++e){if(!(n=arguments[e]+"")||n in i)throw new Error("illegal or duplicate type: "+n);i[n]=[]}return new t(i)}function t(n){this._=n}function r(n,e){return n.trim().split(/^|\s+/).map(function(n){var t="",r=n.indexOf(".");if(r>=0&&(t=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:t}})}function i(n,e){for(var t,r=0,i=n.length;i>r;++r)if((t=n[r]).name===e)return t.value}function o(n,e,t){for(var r=0,i=n.length;i>r;++r)if(n[r].name===e){n[r]=u,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=t&&n.push({name:e,value:t}),n}var a=Array.prototype.slice,u={value:function(){}};e.prototype=t.prototype={on:function(n,e){var t,a=this._,u=r(n+"",a),f=-1,l=u.length;{if(!(arguments.length<2)){for(;++f<l;)if(t=(n=u[f]).type)a[t]=o(a[t],n.name,e);else if(null==e)for(t in a)a[t]=o(a[t],n.name,null);return this}for(;++f<l;)if((t=(n=u[f]).type)&&(t=i(a[t],n.name)))return t}},copy:function(){var n={},e=this._;for(var r in e)n[r]=e[r].slice();return new t(n)},call:function(n,e){this.apply(n,e,a.call(arguments,2))},apply:function(n,e,t){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],i=0,o=r.length;o>i;++i)r[i].value.apply(e,t)}};var f="0.4.0";n.version=f,n.dispatch=e}); | ||
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(n.d3_dispatch={})}(this,function(n){"use strict";function e(){for(var n,e=0,r=arguments.length,i={};r>e;++e){if(!(n=arguments[e]+"")||n in i)throw new Error("illegal or duplicate type: "+n);i[n]=[]}return new t(i)}function t(n){this._=n}function r(n,e){return n.trim().split(/^|\s+/).map(function(n){var t="",r=n.indexOf(".");if(r>=0&&(t=n.slice(r+1),n=n.slice(0,r)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:t}})}function i(n,e){for(var t,r=0,i=n.length;i>r;++r)if((t=n[r]).name===e)return t.value}function o(n,e,t){for(var r=0,i=n.length;i>r;++r)if(n[r].name===e){n[r]=a,n=n.slice(0,r).concat(n.slice(r+1));break}return null!=t&&n.push({name:e,value:t}),n}var a={value:function(){}};e.prototype=t.prototype={on:function(n,e){var t,a=this._,f=r(n+"",a),u=-1,l=f.length;{if(!(arguments.length<2)){for(;++u<l;)if(t=(n=f[u]).type)a[t]=o(a[t],n.name,e);else if(null==e)for(t in a)a[t]=o(a[t],n.name,null);return this}for(;++u<l;)if((t=(n=f[u]).type)&&(t=i(a[t],n.name)))return t}},copy:function(){var n={},e=this._;for(var r in e)n[r]=e[r].slice();return new t(n)},call:function(n,e){if((t=arguments.length-2)>0)for(var t,r=new Array(t),i=0;t>i;++i)r[i]=arguments[i+2];this.apply(n,e,r)},apply:function(n,e,t){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var r=this._[n],i=0,o=r.length;o>i;++i)r[i].value.apply(e,t)}};var f="0.4.1";n.version=f,n.dispatch=e}); |
{ | ||
"name": "d3-dispatch", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Register named callbacks and call them with arguments.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,3 +0,2 @@ | ||
var slice = Array.prototype.slice, | ||
noop = {value: function() {}}; | ||
var noop = {value: function() {}}; | ||
@@ -54,3 +53,4 @@ function dispatch() { | ||
call: function(type, that) { | ||
this.apply(type, that, slice.call(arguments, 2)); | ||
if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n; i < n; ++i) args[i] = arguments[i + 2]; | ||
this.apply(type, that, args); | ||
}, | ||
@@ -57,0 +57,0 @@ apply: function(type, that, args) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
15355
0