Socket
Socket
Sign inDemoInstall

event-emitter

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

event-emitter - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

18

lib/index.js

@@ -26,7 +26,14 @@ 'use strict';

var offt = off.bind(this), nlistener;
if (!this[pname + ' once']) {
defineProperty(this, pname + ' once', d('c', {}));
}
if (!this[pname + ' once'][type]) {
this[pname + ' once'][type] = [[], []];
}
nlistener = function nlistener() {
offt(type, nlistener);
offt(type, listener);
listener.apply(this, arguments);
};
nlistener[pname + ' listener'] = listener;
this[pname + ' once'][type][0].push(nlistener[pname + ' listener'] = listener);
this[pname + ' once'][type][1].push(nlistener);
return on.call(this, type, nlistener);

@@ -40,2 +47,8 @@ };

}
ls = this[pname + ' once'] && this[pname + ' once'][type];
if (ls && ((index = ls[0].indexOf(listener)) !== -1)) {
ls[0].splice(index, 1);
off.call(this, type, ls[1][index]);
ls[1].splice(index, 1);
}
return this;

@@ -46,2 +59,3 @@ };

delete this[pname];
delete this[pname + ' once'];
});

@@ -48,0 +62,0 @@

2

package.json
{
"name": "event-emitter",
"version": "0.1.3",
"version": "0.1.4",
"description": "Basic event emitter for Node.js and browser",

@@ -5,0 +5,0 @@ "keywords": [

@@ -57,2 +57,5 @@ 'use strict';

o.once('test', a.never);
o.off('test', a.never);
o.emit('test');
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc