oberknecht-emitters
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38621
562
Updatedoberknecht-utils@^1.3.7