Comparing version 2.0.0 to 3.0.0
25
index.js
'use strict'; | ||
var prefix = require('eventemitter3').prefixed | ||
, toString = Object.prototype.toString | ||
, slice = Array.prototype.slice | ||
/** | ||
* Get an accurate type description of whatever we receive. | ||
* | ||
* @param {Mixed} what What ever we receive | ||
* @returns {String} Description of what ever it is. | ||
* @api private | ||
*/ | ||
function type(what) { | ||
return toString.call(what).slice(8, -1).toLowerCase(); | ||
} | ||
/** | ||
* Asynchronously emit an event. | ||
@@ -13,3 +28,3 @@ * | ||
module.exports = function asyncemit() { | ||
var args = Array.prototype.slice.call(arguments, 0) | ||
var args = slice.call(arguments, 0) | ||
, event = args.shift() | ||
@@ -21,7 +36,7 @@ , async = args.length | ||
listeners = (this._events || {})['~'+ event] || []; | ||
if (listeners && !Array.isArray(listeners)) { | ||
listeners = [ listeners ]; | ||
} | ||
listeners = (this._events || {})[prefix ? '~'+ event : event]; | ||
if (!listeners) return fn(), this; | ||
if (type(listeners) !== 'array') listeners = [ listeners ]; | ||
/** | ||
@@ -28,0 +43,0 @@ * Simple async helper utility. |
{ | ||
"name": "asyncemit", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Asynchronously emit event an event based on the arguments length.", | ||
@@ -33,7 +33,9 @@ "main": "index.js", | ||
"assume": "1.2.x", | ||
"eventemitter3": "1.0.x", | ||
"istanbul": "0.3.x", | ||
"mocha": "2.2.x", | ||
"pre-commit": "1.0.x" | ||
}, | ||
"peerDependencies": { | ||
"eventemitter3": ">=1.1.0" | ||
} | ||
} |
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
5789
4
62
1