component-emitter
Advanced tools
Comparing version 1.2.1 to 1.3.0
1.3.0 / 2018-04-15 | ||
================== | ||
* removed bower support | ||
* expose emitter on `exports` | ||
* prevent de-optimization from using `arguments` | ||
1.2.1 / 2016-04-18 | ||
@@ -3,0 +10,0 @@ ================== |
14
index.js
@@ -114,2 +114,9 @@ | ||
} | ||
// Remove event specific arrays for event types that no | ||
// one is subscribed for to avoid memory leak. | ||
if (callbacks.length === 0) { | ||
delete this._callbacks['$' + event]; | ||
} | ||
return this; | ||
@@ -128,5 +135,10 @@ }; | ||
this._callbacks = this._callbacks || {}; | ||
var args = [].slice.call(arguments, 1) | ||
var args = new Array(arguments.length - 1) | ||
, callbacks = this._callbacks['$' + event]; | ||
for (var i = 1; i < arguments.length; i++) { | ||
args[i - 1] = arguments[i]; | ||
} | ||
if (callbacks) { | ||
@@ -133,0 +145,0 @@ callbacks = callbacks.slice(0); |
{ | ||
"name": "component-emitter", | ||
"description": "Event emitter", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"license": "MIT", | ||
@@ -23,3 +23,6 @@ "devDependencies": { | ||
}, | ||
"files": ["index.js", "LICENSE"] | ||
"files": [ | ||
"index.js", | ||
"LICENSE" | ||
] | ||
} |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8001
146
0