Comparing version 3.1.2 to 3.1.3
@@ -481,3 +481,3 @@ (function() { | ||
const onceIndex = parent.indexOf(onces[j]); | ||
var onceIndex = parent.indexOf(onces[j]); | ||
if (onceIndex !== -1) { | ||
@@ -543,3 +543,3 @@ parent.splice(onceIndex, 1); | ||
*/ | ||
Emitter.version = '3.1.2'; | ||
Emitter.version = '3.1.3'; | ||
@@ -546,0 +546,0 @@ |
/** | ||
* emmett - A custom event emitter for Node.js and the browser. | ||
* @version v3.1.2 | ||
* @version v3.1.3 | ||
* @link https://github.com/jacomyal/emmett | ||
* @license MIT | ||
*/ | ||
(function(){"use strict";function t(t,e){var n,r={};for(n in t)r[n]=t[n];for(n in e)r[n]=e[n];return r}function e(t){return t&&"object"==typeof t&&!Array.isArray(t)&&!(t instanceof Function)&&!(t instanceof RegExp)}function n(t,e,n){var r,s,i,l;for(s in t)e.call(n||null,s,t[s]);if(Object.getOwnPropertySymbols)for(r=Object.getOwnPropertySymbols(t),i=0,l=r.length;i<l;i++)e.call(n||null,r[i],t[r[i]])}function r(t,e){t=t||[];var n,r,s=[];for(r=0,n=t.length;r<n;r++)t[r].fn!==e&&s.push(t[r]);return s}var s={once:"boolean",scope:"object"},i=0,l=function(){this._enabled=!0,this.unbindAll()};l.prototype.unbindAll=function(){return this._handlers={},this._handlersAll=[],this._handlersComplex=[],this},l.prototype.on=function(t,r,l){var o,h,a,f,p,d,u;if(e(t))return n(t,function(t,e){this.on(t,e,r)},this),this;for("function"==typeof t&&(l=r,r=t,t=null),p=[].concat(t),o=0,h=p.length;o<h;o++){if(f=p[o],u={order:i++,fn:r},"string"==typeof f||"symbol"==typeof f)this._handlers[f]||(this._handlers[f]=[]),d=this._handlers[f],u.type=f;else if(f instanceof RegExp)d=this._handlersComplex,u.pattern=f;else{if(null!==f)throw Error("Emitter.on: invalid event.");d=this._handlersAll}for(a in l||{})s[a]&&(u[a]=l[a]);d.push(u)}return this},l.prototype.once=function(){var n=Array.prototype.slice.call(arguments),r=n.length-1;return e(n[r])&&n.length>1?n[r]=t(n[r],{once:!0}):n.push({once:!0}),this.on.apply(this,n)},l.prototype.off=function(t,s){var i,l,o,h;if(1===arguments.length&&"function"==typeof t){s=arguments[0];for(o in this._handlers)this._handlers[o]=r(this._handlers[o],s),0===this._handlers[o].length&&delete this._handlers[o];this._handlersAll=r(this._handlersAll,s),this._handlersComplex=r(this._handlersComplex,s)}else if(1!==arguments.length||"string"!=typeof t&&"symbol"!=typeof t)if(2===arguments.length){var a=[].concat(t);for(i=0,l=a.length;i<l;i++)h=a[i],this._handlers[h]=r(this._handlers[h],s),0===(this._handlers[h]||[]).length&&delete this._handlers[h]}else e(t)&&n(t,this.off,this);else delete this._handlers[t];return this},l.prototype.listeners=function(t){var e,n,r,s=this._handlersAll||[],i=!1;if(!t)throw Error("Emitter.listeners: no event provided.");for(s=s.concat(this._handlers[t]||[]),n=0,r=this._handlersComplex.length;n<r;n++)e=this._handlersComplex[n],~t.search(e.pattern)&&(i=!0,s.push(e));return this._handlersAll.length||i?s.sort(function(t,e){return t.order-e.order}):s.slice(0)},l.prototype.emit=function(t,r){if(!this._enabled)return this;if(e(t))return n(t,this.emit,this),this;var s,i,l,o,h,a,f,p,d=[].concat(t),u=[];for(h=0,f=d.length;h<f;h++){for(l=this.listeners(d[h]),a=0,p=l.length;a<p;a++)o=l[a],s={type:d[h],target:this},arguments.length>1&&(s.data=r),o.fn.call("scope"in o?o.scope:this,s),o.once&&u.push(o);for(a=u.length-1;a>=0;a--){i=u[a].type?this._handlers[u[a].type]:u[a].pattern?this._handlersComplex:this._handlersAll;const c=i.indexOf(u[a]);c!==-1&&i.splice(c,1)}}return this},l.prototype.kill=function(){this.unbindAll(),this._handlers=null,this._handlersAll=null,this._handlersComplex=null,this._enabled=!1,this.unbindAll=this.on=this.once=this.off=this.emit=this.listeners=Function.prototype},l.prototype.disable=function(){return this._enabled=!1,this},l.prototype.enable=function(){return this._enabled=!0,this},l.version="3.1.2","undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=l),exports.Emitter=l):"function"==typeof define&&define.amd?define("emmett",[],function(){return l}):this.Emitter=l}).call(this); | ||
(function(){"use strict";function t(t,e){var n,r={};for(n in t)r[n]=t[n];for(n in e)r[n]=e[n];return r}function e(t){return t&&"object"==typeof t&&!Array.isArray(t)&&!(t instanceof Function)&&!(t instanceof RegExp)}function n(t,e,n){var r,s,i,l;for(s in t)e.call(n||null,s,t[s]);if(Object.getOwnPropertySymbols)for(r=Object.getOwnPropertySymbols(t),i=0,l=r.length;i<l;i++)e.call(n||null,r[i],t[r[i]])}function r(t,e){t=t||[];var n,r,s=[];for(r=0,n=t.length;r<n;r++)t[r].fn!==e&&s.push(t[r]);return s}var s={once:"boolean",scope:"object"},i=0,l=function(){this._enabled=!0,this.unbindAll()};l.prototype.unbindAll=function(){return this._handlers={},this._handlersAll=[],this._handlersComplex=[],this},l.prototype.on=function(t,r,l){var o,h,a,f,p,d,u;if(e(t))return n(t,function(t,e){this.on(t,e,r)},this),this;for("function"==typeof t&&(l=r,r=t,t=null),p=[].concat(t),o=0,h=p.length;o<h;o++){if(f=p[o],u={order:i++,fn:r},"string"==typeof f||"symbol"==typeof f)this._handlers[f]||(this._handlers[f]=[]),d=this._handlers[f],u.type=f;else if(f instanceof RegExp)d=this._handlersComplex,u.pattern=f;else{if(null!==f)throw Error("Emitter.on: invalid event.");d=this._handlersAll}for(a in l||{})s[a]&&(u[a]=l[a]);d.push(u)}return this},l.prototype.once=function(){var n=Array.prototype.slice.call(arguments),r=n.length-1;return e(n[r])&&n.length>1?n[r]=t(n[r],{once:!0}):n.push({once:!0}),this.on.apply(this,n)},l.prototype.off=function(t,s){var i,l,o,h;if(1===arguments.length&&"function"==typeof t){s=arguments[0];for(o in this._handlers)this._handlers[o]=r(this._handlers[o],s),0===this._handlers[o].length&&delete this._handlers[o];this._handlersAll=r(this._handlersAll,s),this._handlersComplex=r(this._handlersComplex,s)}else if(1!==arguments.length||"string"!=typeof t&&"symbol"!=typeof t)if(2===arguments.length){var a=[].concat(t);for(i=0,l=a.length;i<l;i++)h=a[i],this._handlers[h]=r(this._handlers[h],s),0===(this._handlers[h]||[]).length&&delete this._handlers[h]}else e(t)&&n(t,this.off,this);else delete this._handlers[t];return this},l.prototype.listeners=function(t){var e,n,r,s=this._handlersAll||[],i=!1;if(!t)throw Error("Emitter.listeners: no event provided.");for(s=s.concat(this._handlers[t]||[]),n=0,r=this._handlersComplex.length;n<r;n++)e=this._handlersComplex[n],~t.search(e.pattern)&&(i=!0,s.push(e));return this._handlersAll.length||i?s.sort(function(t,e){return t.order-e.order}):s.slice(0)},l.prototype.emit=function(t,r){if(!this._enabled)return this;if(e(t))return n(t,this.emit,this),this;var s,i,l,o,h,a,f,p,d=[].concat(t),u=[];for(h=0,f=d.length;h<f;h++){for(l=this.listeners(d[h]),a=0,p=l.length;a<p;a++)o=l[a],s={type:d[h],target:this},arguments.length>1&&(s.data=r),o.fn.call("scope"in o?o.scope:this,s),o.once&&u.push(o);for(a=u.length-1;a>=0;a--){i=u[a].type?this._handlers[u[a].type]:u[a].pattern?this._handlersComplex:this._handlersAll;var c=i.indexOf(u[a]);c!==-1&&i.splice(c,1)}}return this},l.prototype.kill=function(){this.unbindAll(),this._handlers=null,this._handlersAll=null,this._handlersComplex=null,this._enabled=!1,this.unbindAll=this.on=this.once=this.off=this.emit=this.listeners=Function.prototype},l.prototype.disable=function(){return this._enabled=!1,this},l.prototype.enable=function(){return this._enabled=!0,this},l.version="3.1.3","undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=l),exports.Emitter=l):"function"==typeof define&&define.amd?define("emmett",[],function(){return l}):this.Emitter=l}).call(this); |
{ | ||
"name": "emmett", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"description": "A custom event emitter for Node.js and the browser.", | ||
@@ -5,0 +5,0 @@ "main": "emmett.js", |
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
22925