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.4 to 1.0.5

11

lib-js/emitters/oberknecht.emitter.js

@@ -59,5 +59,12 @@ "use strict";

this.getListeners(a).forEach((callback) => {
if (this._options.withAllNames)
let withNames = this._options.withNames;
let withAllNames = this._options.withAllNames;
if (withAllNames &&
(withAllNames === true ||
((0, oberknecht_utils_1.extendedTypeof)(withAllNames) === "array" &&
withAllNames.includes(a))))
callback([a, ...eventNames.filter((b) => a !== b)], args ?? undefined);
else if (this._options.withNames)
else if (withNames &&
(withNames === true ||
((0, oberknecht_utils_1.extendedTypeof)(withNames) === "array" && withNames.includes(a))))
callback(a, args ?? undefined);

@@ -64,0 +71,0 @@ else

4

lib-js/types/oberknecht.emitter.options.d.ts
export type oberknechtEmitterOptions = {
withNames?: boolean;
withAllNames?: boolean;
withNames?: boolean | string[];
withAllNames?: boolean | string[];
};

@@ -1,2 +0,2 @@

import { convertToArray, returnErr } from "oberknecht-utils";
import { convertToArray, extendedTypeof, returnErr } from "oberknecht-utils";
import { i } from "..";

@@ -75,3 +75,11 @@ import { oberknechtEmitterOptions } from "../types/oberknecht.emitter.options";

this.getListeners(a).forEach((callback: Function) => {
if (this._options.withAllNames)
let withNames = this._options.withNames;
let withAllNames = this._options.withAllNames;
if (
withAllNames &&
(withAllNames === true ||
(extendedTypeof(withAllNames) === "array" &&
withAllNames.includes(a)))
)
callback(

@@ -81,3 +89,8 @@ [a, ...eventNames.filter((b) => a !== b)],

);
else if (this._options.withNames) callback(a, args ?? undefined);
else if (
withNames &&
(withNames === true ||
(extendedTypeof(withNames) === "array" && withNames.includes(a)))
)
callback(a, args ?? undefined);
else callback(args ?? undefined);

@@ -84,0 +97,0 @@ });

export type oberknechtEmitterOptions = {
withNames?: boolean;
withAllNames?: boolean;
withNames?: boolean | string[];
withAllNames?: boolean | string[];
};
{
"name": "oberknecht-emitters",
"version": "1.0.4",
"version": "1.0.5",
"description": "",

@@ -5,0 +5,0 @@ "main": "export",

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