New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@carry0987/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

@carry0987/event-emitter - npm Package Compare versions

Comparing version 1.4.2 to 1.4.3

2

dist/eventEmitter.esm.js

@@ -99,4 +99,4 @@ class EventEmitter {

const version = '1.4.2';
const version = '1.4.3';
export { EventEmitter, version };

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).eventEmitter={})}(this,(function(e){"use strict";e.EventEmitter=class{callbacks={};init(e){e&&!this.callbacks[e]&&(this.callbacks[e]=[])}checkListener(e){if("function"!=typeof e)throw new TypeError("The listener must be a function")}hasEvent(e){return void 0!==this.callbacks[e]}listeners(){return this.callbacks}addListener(e,t){return this.on(e,t)}clearListener(e){return e?this.callbacks[e]=[]:this.callbacks={},this}on(e,t){return this.checkListener(t),this.init(e),this.callbacks[e].push(t),this}off(e,t){this.checkListener(t);const s=e;return this.init(),this.callbacks[s]&&0!==this.callbacks[s].length?(this.callbacks[s]=this.callbacks[s].filter((e=>e!=t)),this):this}emit(e,...t){const s=e;if(this.init(s),this.callbacks[s].length<=0)return!1;const i=this.callbacks[s].map((e=>{try{const s=e(...t);return s instanceof Promise?s:Promise.resolve(s)}catch(e){return console.error(`Error in event listener for event: ${s}`,e),Promise.resolve()}}));return!i.some((e=>e instanceof Promise))||Promise.all(i).then((()=>!0)).catch((e=>(console.error(`Error handling promises for event: ${s}`,e),!1)))}once(e,t){this.checkListener(t);const s=(...i)=>{const n=t(...i);return this.off(e,s),n instanceof Promise?n:Promise.resolve(n)};return this.on(e,s)}},e.version="1.4.2"}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).eventEmitter={})}(this,(function(e){"use strict";e.EventEmitter=class{callbacks={};init(e){e&&!this.callbacks[e]&&(this.callbacks[e]=[])}checkListener(e){if("function"!=typeof e)throw new TypeError("The listener must be a function")}hasEvent(e){return void 0!==this.callbacks[e]}listeners(){return this.callbacks}addListener(e,t){return this.on(e,t)}clearListener(e){return e?this.callbacks[e]=[]:this.callbacks={},this}on(e,t){return this.checkListener(t),this.init(e),this.callbacks[e].push(t),this}off(e,t){this.checkListener(t);const s=e;return this.init(),this.callbacks[s]&&0!==this.callbacks[s].length?(this.callbacks[s]=this.callbacks[s].filter((e=>e!=t)),this):this}emit(e,...t){const s=e;if(this.init(s),this.callbacks[s].length<=0)return!1;const i=this.callbacks[s].map((e=>{try{const s=e(...t);return s instanceof Promise?s:Promise.resolve(s)}catch(e){return console.error(`Error in event listener for event: ${s}`,e),Promise.resolve()}}));return!i.some((e=>e instanceof Promise))||Promise.all(i).then((()=>!0)).catch((e=>(console.error(`Error handling promises for event: ${s}`,e),!1)))}once(e,t){this.checkListener(t);const s=(...i)=>{const n=t(...i);return this.off(e,s),n instanceof Promise?n:Promise.resolve(n)};return this.on(e,s)}},e.version="1.4.3"}));
{
"name": "@carry0987/event-emitter",
"version": "1.4.2",
"version": "1.4.3",
"description": "EventEmitter is a TypeScript library that provides a simple yet powerful event-handling mechanism. It allows you to define and manage events in your application.",
"type": "module",
"main": "dist/eventEmitter.min.js",
"main": "dist/eventEmitter.esm.js",
"module": "dist/eventEmitter.esm.js",

@@ -8,0 +8,0 @@ "types": "dist/index.d.ts",

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