Socket
Socket
Sign inDemoInstall

oberknecht-emitters

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

oberknecht-emitters - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

7

lib-js/emitters/oberknecht.emitter.js

@@ -56,5 +56,8 @@ "use strict";

let eventName_ = (0, oberknecht_utils_1.convertToArray)(eventName);
[...eventName_, "_all"].forEach((a) => {
let eventNames = [...eventName_, "_all"];
eventNames.forEach((a) => {
this.getListeners(a).forEach((callback) => {
if (this._options.withNames)
if (this._options.withAllNames)
callback([a, ...eventNames.filter((b) => a !== b)], args ?? undefined);
else if (this._options.withNames)
callback(a, args ?? undefined);

@@ -61,0 +64,0 @@ else

export type oberknechtEmitterOptions = {
withNames?: boolean;
withAllNames?: boolean;
};

@@ -71,6 +71,12 @@ import { convertToArray, returnErr } from "oberknecht-utils";

let eventName_ = convertToArray(eventName);
let eventNames = [...eventName_, "_all"];
[...eventName_, "_all"].forEach((a) => {
eventNames.forEach((a) => {
this.getListeners(a).forEach((callback: Function) => {
if (this._options.withNames) callback(a, args ?? undefined);
if (this._options.withAllNames)
callback(
[a, ...eventNames.filter((b) => a !== b)],
args ?? undefined
);
else if (this._options.withNames) callback(a, args ?? undefined);
else callback(args ?? undefined);

@@ -77,0 +83,0 @@ });

export type oberknechtEmitterOptions = {
withNames?: boolean;
withAllNames?: boolean;
};
{
"name": "oberknecht-emitters",
"version": "1.0.3",
"version": "1.0.4",
"description": "",

@@ -22,7 +22,7 @@ "main": "export",

"@types/node": "^20.2.5",
"oberknecht-utils": ">=0.0.3"
"oberknecht-utils": "^1.3.7"
},
"devDependencies": {
"typescript": "^5.2.0-dev.20230607"
"typescript": "^5.1.6"
}
}
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