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

betsy

Package Overview
Dependencies
Maintainers
1
Versions
797
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

betsy - npm Package Compare versions

Comparing version 1.0.0-1532691371168 to 1.0.0-1532810720851

1

es/index.d.ts

@@ -9,2 +9,3 @@ export declare type Listener = {

emit<K extends keyof T>(event: K, msg: T[K]): void;
emitAsync<K extends keyof T>(event: K, msg: T[K]): void;
on<K extends keyof T>(event: K, cb: (msg: T[K]) => void): void;

@@ -11,0 +12,0 @@ once<K extends keyof T>(event: K, cb: (msg: T[K]) => void): void;

@@ -15,2 +15,14 @@ var EventEmitter = /** @class */ (function () {

};
EventEmitter.prototype.emitAsync = function (event, msg) {
var listeners = this.events.get(event) || [];
setTimeout(function () {
for (var i = listeners.length - 1; i >= 0; i--) {
var listener = listeners[i];
listener.cb(msg);
if (listener.once) {
listeners.splice(i, 1);
}
}
});
};
EventEmitter.prototype.on = function (event, cb) {

@@ -17,0 +29,0 @@ this.addListener(event, cb, false);

@@ -9,2 +9,3 @@ export declare type Listener = {

emit<K extends keyof T>(event: K, msg: T[K]): void;
emitAsync<K extends keyof T>(event: K, msg: T[K]): void;
on<K extends keyof T>(event: K, cb: (msg: T[K]) => void): void;

@@ -11,0 +12,0 @@ once<K extends keyof T>(event: K, cb: (msg: T[K]) => void): void;

@@ -17,2 +17,14 @@ "use strict";

};
EventEmitter.prototype.emitAsync = function (event, msg) {
var listeners = this.events.get(event) || [];
setTimeout(function () {
for (var i = listeners.length - 1; i >= 0; i--) {
var listener = listeners[i];
listener.cb(msg);
if (listener.once) {
listeners.splice(i, 1);
}
}
});
};
EventEmitter.prototype.on = function (event, cb) {

@@ -19,0 +31,0 @@ this.addListener(event, cb, false);

2

package.json
{
"name": "betsy",
"version": "1.0.0-1532691371168",
"version": "1.0.0-1532810720851",
"description": "Typed events",

@@ -5,0 +5,0 @@ "author": "Christian Alfoni <christianalfoni@gmail.com>",

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