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.2.2 to 2.3.0

33

index.js

@@ -291,1 +291,34 @@ const errors = require('./lib/errors')

}
exports.forward = function forward (from, to, ...names) {
let opts = names.pop()
if (typeof opts === 'string') {
names.push(opts)
opts = {}
}
const {
emit = to.emit.bind(to)
} = opts
const listeners = names.map((name) => function onevent (...args) {
emit(name, ...args)
})
to
.on('newListener', (name) => {
const i = names.indexOf(name)
if (i !== -1 && to.listenerCount(name) === 0) {
from.on(name, listeners[i])
}
})
.on('removeListener', (name) => {
const i = names.indexOf(name)
if (i !== -1 && to.listenerCount(name) === 0) {
from.off(name, listeners[i])
}
})
}

2

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

@@ -5,0 +5,0 @@ "main": "index.js",

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