wolfy87-eventemitter
Advanced tools
Comparing version 5.2.5 to 5.2.6
{ | ||
"name": "eventEmitter", | ||
"description": "Event based JavaScript for the browser", | ||
"version": "5.2.5", | ||
"version": "5.2.6", | ||
"main": "EventEmitter.js", | ||
@@ -6,0 +6,0 @@ "author": { |
# EventEmitter changes | ||
# v5.2.6 | ||
* Merge [#149](https://github.com/Olical/EventEmitter/pull/149) - Correct method signatures in TypeScript file. | ||
# v5.2.5 | ||
@@ -4,0 +8,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "Event based JavaScript for the browser.", | ||
"version": "5.2.5", | ||
"version": "5.2.6", | ||
"scripts": ["EventEmitter.js"], | ||
@@ -8,0 +8,0 @@ "files": ["EventEmitter.d.ts"], |
@@ -429,3 +429,2 @@ // Shamelessly copied from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/wolfy87-eventemitter/index.d.ts | ||
* So they will not arrive within the array on the other side, they will be separate. | ||
* You can also pass a regular expression to emit to all events that match it. | ||
* | ||
@@ -436,11 +435,10 @@ * @param {String|RegExp} event Name of the event to emit and execute listeners for. | ||
*/ | ||
emitEvent(event: string, ...args: any[]): EventEmitter; | ||
emitEvent(event: string, args: any[]): EventEmitter; | ||
/** | ||
* Emits an event of your choice. | ||
* When emitted, every listener attached to that event will be executed. | ||
* Emits to all events that match the regular expression passed | ||
* When emitted, every listener attached to the event(s) will be executed. | ||
* If you pass the optional argument array then those arguments will be passed to every listener upon execution. | ||
* Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. | ||
* So they will not arrive within the array on the other side, they will be separate. | ||
* You can also pass a regular expression to emit to all events that match it. | ||
* | ||
@@ -451,3 +449,3 @@ * @param {String|RegExp} event Name of the event to emit and execute listeners for. | ||
*/ | ||
emitEvent(event: RegExp, ...args: any[]): EventEmitter; | ||
emitEvent(event: RegExp, args: any[]): EventEmitter; | ||
@@ -460,3 +458,2 @@ /** | ||
* So they will not arrive within the array on the other side, they will be separate. | ||
* You can also pass a regular expression to emit to all events that match it. | ||
* | ||
@@ -467,11 +464,10 @@ * @param {String|RegExp} event Name of the event to emit and execute listeners for. | ||
*/ | ||
trigger(event: string, ...args: any[]): EventEmitter; | ||
trigger(event: string, args: any[]): EventEmitter; | ||
/** | ||
* Emits an event of your choice. | ||
* When emitted, every listener attached to that event will be executed. | ||
* Emits to all events that match the regular expression passed | ||
* When emitted, every listener attached to the event(s) will be executed. | ||
* If you pass the optional argument array then those arguments will be passed to every listener upon execution. | ||
* Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately. | ||
* So they will not arrive within the array on the other side, they will be separate. | ||
* You can also pass a regular expression to emit to all events that match it. | ||
* | ||
@@ -482,3 +478,3 @@ * @param {String|RegExp} event Name of the event to emit and execute listeners for. | ||
*/ | ||
trigger(event: RegExp, ...args: any[]): EventEmitter; | ||
trigger(event: RegExp, args: any[]): EventEmitter; | ||
@@ -485,0 +481,0 @@ /** |
/*! | ||
* EventEmitter v5.2.5 - git.io/ee | ||
* EventEmitter v5.2.6 - git.io/ee | ||
* Unlicense - http://unlicense.org/ | ||
* Oliver Caldwell - http://oli.me.uk/ | ||
* Oliver Caldwell - https://oli.me.uk/ | ||
* @preserve | ||
@@ -6,0 +6,0 @@ */ |
/*! | ||
* EventEmitter v5.2.5 - git.io/ee | ||
* EventEmitter v5.2.6 - git.io/ee | ||
* Unlicense - http://unlicense.org/ | ||
* Oliver Caldwell - http://oli.me.uk/ | ||
* Oliver Caldwell - https://oli.me.uk/ | ||
* @preserve | ||
*/ | ||
!function(e){"use strict";function t(){}function n(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function r(e){return function(){return this[e].apply(this,arguments)}}function i(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&i(e.listener)}var s=t.prototype,o=e.EventEmitter;s.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[e]=[]);return t},s.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},s.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},s.addListener=function(e,t){if(!i(t))throw new TypeError("listener must be a function");var r,s=this.getListenersAsObject(e),o="object"==typeof t;for(r in s)s.hasOwnProperty(r)&&-1===n(s[r],t)&&s[r].push(o?t:{listener:t,once:!1});return this},s.on=r("addListener"),s.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},s.once=r("addOnceListener"),s.defineEvent=function(e){return this.getListeners(e),this},s.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},s.removeListener=function(e,t){var r,i,s=this.getListenersAsObject(e);for(i in s)s.hasOwnProperty(i)&&-1!==(r=n(s[i],t))&&s[i].splice(r,1);return this},s.off=r("removeListener"),s.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},s.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},s.manipulateListeners=function(e,t,n){var r,i,s=e?this.removeListener:this.addListener,o=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)s.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(i=t[r])&&("function"==typeof i?s.call(this,r,i):o.call(this,r,i));return this},s.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},s.removeAllListeners=r("removeEvent"),s.emitEvent=function(e,t){var n,r,i,s,o=this.getListenersAsObject(e);for(s in o)if(o.hasOwnProperty(s))for(n=o[s].slice(0),i=0;i<n.length;i++)r=n[i],!0===r.once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},s.trigger=r("emitEvent"),s.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},s.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},s._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},s._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return e.EventEmitter=o,t},"function"==typeof define&&define.amd?define(function(){return t}):"object"==typeof module&&module.exports?module.exports=t:e.EventEmitter=t}("undefined"!=typeof window?window:this||{}); |
{ | ||
"name": "wolfy87-eventemitter", | ||
"version": "5.2.5", | ||
"version": "5.2.6", | ||
"description": "Event based JavaScript for the browser", | ||
@@ -5,0 +5,0 @@ "main": "EventEmitter.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
109697
1630