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

strict-event-emitter

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strict-event-emitter - npm Package Compare versions

Comparing version 0.2.8 to 0.3.0

lib/StrictEventTarget.d.ts

1

lib/index.d.ts
export * from './StrictEventEmitter';
export * from './StrictEventTarget';

3

lib/index.js

@@ -12,3 +12,4 @@ "use strict";

};
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./StrictEventEmitter"), exports);
__exportStar(require("./StrictEventTarget"), exports);
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __spreadArrays = (this && this.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StrictEventEmitter = void 0;
var events_1 = require("events");
var StrictEventEmitter = /** @class */ (function (_super) {
__extends(StrictEventEmitter, _super);
function StrictEventEmitter() {
return _super.call(this) || this;
const events_1 = require("events");
class StrictEventEmitter extends events_1.EventEmitter {
constructor() {
super();
}
StrictEventEmitter.prototype.on = function (event, listener) {
return _super.prototype.on.call(this, event.toString(), listener);
};
StrictEventEmitter.prototype.once = function (event, listener) {
return _super.prototype.once.call(this, event.toString(), listener);
};
StrictEventEmitter.prototype.off = function (event, listener) {
return _super.prototype.off.call(this, event.toString(), listener);
};
StrictEventEmitter.prototype.emit = function (event) {
var data = [];
for (var _i = 1; _i < arguments.length; _i++) {
data[_i - 1] = arguments[_i];
}
return _super.prototype.emit.apply(this, __spreadArrays([event.toString()], data));
};
StrictEventEmitter.prototype.addListener = function (event, listener) {
return _super.prototype.addListener.call(this, event.toString(), listener);
};
StrictEventEmitter.prototype.prependListener = function (event, listener) {
return _super.prototype.prependListener.call(this, event.toString(), listener);
};
StrictEventEmitter.prototype.prependOnceListener = function (event, listener) {
return _super.prototype.prependOnceListener.call(this, event.toString(), listener);
};
StrictEventEmitter.prototype.removeListener = function (event, listener) {
return _super.prototype.removeListener.call(this, event.toString(), listener);
};
StrictEventEmitter.prototype.removeAllListeners = function (event) {
on(event, listener) {
return super.on(event.toString(), listener);
}
once(event, listener) {
return super.once(event.toString(), listener);
}
off(event, listener) {
return super.off(event.toString(), listener);
}
emit(event, ...data) {
return super.emit(event.toString(), ...data);
}
addListener(event, listener) {
return super.addListener(event.toString(), listener);
}
prependListener(event, listener) {
return super.prependListener(event.toString(), listener);
}
prependOnceListener(event, listener) {
return super.prependOnceListener(event.toString(), listener);
}
removeListener(event, listener) {
return super.removeListener(event.toString(), listener);
}
removeAllListeners(event) {
if (event) {
return _super.prototype.removeAllListeners.call(this, event.toString());
return super.removeAllListeners(event.toString());
}
return _super.prototype.removeAllListeners.call(this);
};
StrictEventEmitter.prototype.eventNames = function () {
return _super.prototype.eventNames.call(this);
};
StrictEventEmitter.prototype.listeners = function (event) {
return _super.prototype.listeners.call(this, event.toString());
};
StrictEventEmitter.prototype.rawListeners = function (event) {
return _super.prototype.rawListeners.call(this, event.toString());
};
StrictEventEmitter.prototype.listenerCount = function (event) {
return _super.prototype.listenerCount.call(this, event.toString());
};
return StrictEventEmitter;
}(events_1.EventEmitter));
return super.removeAllListeners();
}
eventNames() {
return super.eventNames();
}
listeners(event) {
return super.listeners(event.toString());
}
rawListeners(event) {
return super.rawListeners(event.toString());
}
listenerCount(event) {
return super.listenerCount(event.toString());
}
}
exports.StrictEventEmitter = StrictEventEmitter;
{
"name": "strict-event-emitter",
"version": "0.2.8",
"version": "0.3.0",
"description": "Type-safe \"EventEmitter\" for everyday use",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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