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

betsy

Package Overview
Dependencies
Maintainers
2
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.2-1626779281664 to 1.0.2-1626780376817

48

es/index.js

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

var EventEmitter = /** @class */ (function () {
function EventEmitter() {
export class EventEmitter {
constructor() {
this.events = new Map();
}
EventEmitter.prototype.emit = function (event, msg) {
var listeners = this.events.get(event) || [];
for (var i = listeners.length - 1; i >= 0; i--) {
var listener = listeners[i];
emit(event, msg) {
const listeners = this.events.get(event) || [];
for (let i = listeners.length - 1; i >= 0; i--) {
const listener = listeners[i];
listener.cb(msg);

@@ -14,8 +14,8 @@ if (listener.once) {

}
};
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];
}
emitAsync(event, msg) {
const listeners = this.events.get(event) || [];
setTimeout(() => {
for (let i = listeners.length - 1; i >= 0; i--) {
const listener = listeners[i];
listener.cb(msg);

@@ -27,20 +27,18 @@ if (listener.once) {

});
};
EventEmitter.prototype.on = function (event, cb) {
}
on(event, cb) {
this.addListener(event, cb, false);
};
EventEmitter.prototype.once = function (event, cb) {
}
once(event, cb) {
this.addListener(event, cb, true);
};
EventEmitter.prototype.addListener = function (event, cb, once) {
var listeners = this.events.get(event) || [];
}
addListener(event, cb, once) {
const listeners = this.events.get(event) || [];
listeners.push({
once: once,
cb: cb,
once,
cb,
});
this.events.set(event, listeners);
};
return EventEmitter;
}());
export { EventEmitter };
}
}
//# sourceMappingURL=index.js.map
{
"name": "betsy",
"version": "1.0.2-1626779281664",
"version": "1.0.2-1626780376817",
"description": "Typed events",

@@ -14,3 +14,3 @@ "author": "Christian Alfoni <christianalfoni@gmail.com>",

"build:lib": "tsc --outDir lib --module commonjs",
"build:es": "tsc --outDir es --module es2015",
"build:es": "tsc --outDir es --module ES2020 --target ES2020",
"clean": "rimraf es lib coverage",

@@ -17,0 +17,0 @@ "typecheck": "tsc --noEmit",

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