Socket
Socket
Sign inDemoInstall

emitix

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.6 to 1.1.7

2

dist/index.js

@@ -1,1 +0,1 @@

"use strict";function Events(){}Object.defineProperty(exports,"__esModule",{value:!0});var Listener=function(e,n){this.fn=e,this.once=n||!1};function addEvent(e,n,t){e._events[n]?Array.isArray(e._events[n])?e._events[n].push(t):e._events[n]=[e._events[n],t]:(e._events[n]=t,e._eventCount++)}function rmOnceListener(e,n,t){var r=e._events[n];if(r)if(r.fn&&r==t)clearEvent(e,n);else{for(var i=0;i<r.length;i++)r[i]==t&&r.splice(i,1);0===r.length&&clearEvent(e,n)}}function clearEvent(e,n){0==--e._eventCount?(e._events=new Events,e._eventCount=0):delete e._events[n]}var ProtectedEventEmitterEmit=function(){function e(){}return e.prototype.emit=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t]},e}(),EventEmitter=function(){function e(){this._events=new Events,this._eventCount=0}return e.prototype.off=function(e,n){if(e){if(!this._events[e])return;if(!n)return clearEvent(this,e);var t=this._events[e];if(t.fn&&t.fn===n)return clearEvent(this,e);for(var r=0;r<t.length;r++)t[r].fn==n&&t.splice(r,1);0===t.length&&clearEvent(this,e)}else this._events=new Events,this._eventCount=0},e.prototype.offEventsFilter=function(e){for(var n=Object.keys(this._events),t=0,r=n.length;t<r;t++)e(n[t])&&clearEvent(this,n[t])},e.prototype.on=function(e,n){addEvent(this,e,new Listener(n))},e.prototype.once=function(n,t){var r=this;if("function"!=typeof t)return new Promise(t?function(i,s){var o,f=setTimeout((function(){rmOnceListener(r,o,o),s(e.onceTimeoutErrorCreator())}),t);addEvent(r,n,o=new Listener((function(){clearTimeout(f),i(arguments)}),!0))}:function(e){return addEvent(r,n,new Listener(e,!0))});addEvent(this,n,new Listener(t,!0))},e.prototype.emit=function(e,n,t,r,i,s){var o=this._events[e],f=arguments.length;if(o)if(o.fn){switch(o.once&&rmOnceListener(this,e,o),f){case 1:return o.fn();case 2:return o.fn(n);case 3:return o.fn(n,t);case 4:return o.fn(n,t,r);case 5:return o.fn(n,t,r,i);case 6:return o.fn(n,t,r,i,s)}for(var c=1,a=new Array(f-1);c<f;c++)a[c-1]=arguments[c];o.fn.apply(null,a)}else{a=void 0;var v=void 0;for(c=0;c<o.length;){switch(f){case 1:o[c].fn();break;case 2:o[c].fn(n);break;case 3:o[c].fn(n,t);break;case 4:o[c].fn(n,t,r);break;case 5:o[c].fn(n,t,r,i);break;case 6:o[c].fn(n,t,r,i,s);break;default:if(!a)for(v=1,a=new Array(f-1);v<f;v++)a[v-1]=arguments[v];o[c].fn.apply(null,a)}o[c].once?rmOnceListener(this,e,o[c]):c++}}},e.Protected=function(){return e},e.onceTimeoutErrorCreator=function(){var e=new Error("Once listener timeout reached.");return e.name="Timeout",e},e}();exports.default=EventEmitter;
"use strict";function Events(){}Object.defineProperty(exports,"__esModule",{value:!0});var Listener=function(e,n){this.fn=e,this.once=n||!1};function addEvent(e,n,t){e._events[n]?Array.isArray(e._events[n])?e._events[n].push(t):e._events[n]=[e._events[n],t]:(e._events[n]=t,e._eventCount++)}function rmOnceListener(e,n,t){var r=e._events[n];if(r)if(r.fn&&r==t)clearEvent(e,n);else{for(var i=r.length-1;i>-1;i--)r[i]==t&&r.splice(i,1);0===r.length&&clearEvent(e,n)}}function clearEvent(e,n){0==--e._eventCount?(e._events=new Events,e._eventCount=0):delete e._events[n]}var ProtectedEventEmitterEmit=function(){function e(){}return e.prototype.emit=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t]},e}(),EventEmitter=function(){function e(){this._events=new Events,this._eventCount=0}return e.prototype.off=function(e,n){if(e){if(!this._events[e])return;if(!n)return clearEvent(this,e);var t=this._events[e];if(t.fn&&t.fn===n)return clearEvent(this,e);for(var r=t.length-1;r>-1;r--)t[r].fn==n&&t.splice(r,1);0===t.length&&clearEvent(this,e)}else this._events=new Events,this._eventCount=0},e.prototype.offEventsFilter=function(e){for(var n=Object.keys(this._events),t=0,r=n.length;t<r;t++)e(n[t])&&clearEvent(this,n[t])},e.prototype.on=function(e,n){addEvent(this,e,new Listener(n))},e.prototype.once=function(n,t){var r=this;if("function"!=typeof t)return new Promise(t?function(i,s){var o,f=setTimeout((function(){rmOnceListener(r,o,o),s(e.onceTimeoutErrorCreator())}),t);addEvent(r,n,o=new Listener((function(){clearTimeout(f),i(arguments)}),!0))}:function(e){return addEvent(r,n,new Listener(e,!0))});addEvent(this,n,new Listener(t,!0))},e.prototype.emit=function(e,n,t,r,i,s){var o=this._events[e],f=arguments.length;if(o)if(o.fn){switch(o.once&&rmOnceListener(this,e,o),f){case 1:return o.fn();case 2:return o.fn(n);case 3:return o.fn(n,t);case 4:return o.fn(n,t,r);case 5:return o.fn(n,t,r,i);case 6:return o.fn(n,t,r,i,s)}for(var c=1,a=new Array(f-1);c<f;c++)a[c-1]=arguments[c];o.fn.apply(null,a)}else{a=void 0;var v=void 0;for(c=0;c<o.length;){switch(f){case 1:o[c].fn();break;case 2:o[c].fn(n);break;case 3:o[c].fn(n,t);break;case 4:o[c].fn(n,t,r);break;case 5:o[c].fn(n,t,r,i);break;case 6:o[c].fn(n,t,r,i,s);break;default:if(!a)for(v=1,a=new Array(f-1);v<f;v++)a[v-1]=arguments[v];o[c].fn.apply(null,a)}o[c].once?rmOnceListener(this,e,o[c]):c++}}},e.Protected=function(){return e},e.onceTimeoutErrorCreator=function(){var e=new Error("Once listener timeout reached.");return e.name="Timeout",e},e}();exports.default=EventEmitter;
{
"name": "emitix",
"version": "1.1.6",
"version": "1.1.7",
"description": "Fast, powerful, modern and lightweight EventEmitter.",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc