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

arbitrary-emitter

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arbitrary-emitter - npm Package Compare versions

Comparing version 0.8.3 to 0.9.0

28

arbitrary-emitter.js

@@ -8,4 +8,4 @@ 'use strict'

const size = triggers.size
if (!size) return listeners.delete(lis.key)
if (size === 1) {
if (!size) listeners.delete(lis.key)
else if (size === 1) {
let fn

@@ -70,9 +70,11 @@ triggers.forEach(f => { fn = f })

const al = arguments.length
if (al === 1) return lis.launch0()
if (al > 4) return lis.launch1(arguments[1], arguments[2])
let args = new Array(al - 1)
for (let i = 1; i < al; ++i) {
args[i - 1] = arguments[i]
if (al === 1) lis.launch0()
else if (al > 4) lis.launch1(arguments[1], arguments[2])
else {
let args = new Array(al - 1)
for (let i = 1; i < al; ++i) {
args[i - 1] = arguments[i]
}
lis.launchX(args)
}
lis.launchX(args)
},

@@ -87,3 +89,3 @@

let args = arguments[1]
if (!Array.isArray(args)) {
if (typeof args !== 'object') {
throw new Error('arguments has wrong type')

@@ -95,8 +97,4 @@ }

off (key, action) {
if (1 in arguments) {
let lis = listeners.get(key)
if (lis) lis.rm(action)
} else {
listeners.delete(key)
}
if (!(1 in arguments)) listeners.delete(key)
else if (listeners.has(key)) listeners.get(key).rm(action)
}

@@ -103,0 +101,0 @@ }

{
"name": "arbitrary-emitter",
"version": "0.8.3",
"version": "0.9.0",
"description": "Event emitter with Map/Set sugar for modern browsers and node.js",

@@ -5,0 +5,0 @@ "main": "arbitrary-emitter.js",

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