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

bare-events

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-events - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

25

index.js

@@ -33,2 +33,13 @@ const errors = require('./lib/errors')

removeAll (ctx, name) {
const list = [...this.list]
this.list = []
for (let i = list.length - 1; i >= 0; i--) {
ctx.emit('removeListener', name, list[i][0]) // Emit AFTER removing
}
if (this.list.length === 0) delete ctx._events[name]
}
emit (ctx, name, ...args) {

@@ -124,2 +135,16 @@ const list = [...this.list]

setMaxListeners (n) {}
removeAllListeners (name) {
if (arguments.length === 0) {
for (const key of Reflect.ownKeys(this._events)) {
if (key === 'removeListener') continue
this.removeAllListeners(key)
}
this.removeAllListeners('removeListener')
} else {
const e = this._events[name]
if (e !== undefined) e.removeAll(this, name)
}
return this
}
}

@@ -126,0 +151,0 @@

4

package.json
{
"name": "bare-events",
"version": "2.0.0",
"version": "2.1.0",
"description": "Event emitters for JavaScript",

@@ -15,3 +15,3 @@ "main": "index.js",

"type": "git",
"url": "https://github.com/holepunchto/bare-events.git"
"url": "git+https://github.com/holepunchto/bare-events.git"
},

@@ -18,0 +18,0 @@ "author": "Holepunch",

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