Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

es-emitter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-emitter - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "es-emitter",
"version": "0.0.1",
"version": "0.0.2",
"description": "A small function that produces an emitter",

@@ -5,0 +5,0 @@ "repository": "https://github.com/blakelapierre/es-emitter",

module.exports = () => {
return listenerInterceptor => {
var events = {};
const events = {};

@@ -13,6 +13,6 @@ return {

function emit(events, event) {
var listeners = events[event] || [],
const listeners = events[event] || [],
args = Array.prototype.slice.call(arguments, 2);
for (var i = 0; i < listeners.length; i++) {
for (let i = 0; i < listeners.length; i++) {
listeners[i].apply(null, args);

@@ -24,3 +24,3 @@ }

if (typeof event == 'object') {
var unregister = () => _.each(unregister, fn => fn());
const unregister = () => _.each(unregister, fn => fn());
return _.transform(event, (result, listener, eventName) => {

@@ -32,3 +32,3 @@ result[eventName] = on(events, listenerInterceptor, eventName, listener);

if (listenerInterceptor) {
var ret = listenerInterceptor.attemptIntercept(event, listener);
const ret = listenerInterceptor.attemptIntercept(event, listener);
if (ret) return ret;

@@ -45,7 +45,7 @@ }

if (typeof event == 'object') {
for (var eventName in event) off(events, eventName, event[eventName]);
for (let eventName in event) off(events, eventName, event[eventName]);
return;
}
var listeners = events[event];
const listeners = events[event];
if (listeners && listeners.length > 0) {

@@ -57,3 +57,3 @@ removeListener(listeners, listener);

function removeListener(listeners, listener) {
for (var i = listeners.length - 1; i >= 0; i--) {
for (let i = listeners.length - 1; i >= 0; i--) {
if (listeners[i] === listener) {

@@ -60,0 +60,0 @@ listeners.splice(i, 1);

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