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

nanoevents

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanoevents - npm Package Compare versions

Comparing version 5.1.10 to 5.1.11

3

CHANGELOG.md
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 5.1.11
* Fixed unsubscribing on cleaned `Emitter#events` (by Mikhail Nasyrov).
## 5.1.10

@@ -5,0 +8,0 @@ * Fixed `package.types` path.

7

index.js
let createNanoEvents = () => ({
events: {},
emit (event, ...args) {
for (let i of this.events[event] || []) {
i(...args)
}
;(this.events[event] || []).forEach(i => i(...args))
},
on (event, cb) {
;(this.events[event] = this.events[event] || []).push(cb)
return () => (this.events[event] = this.events[event].filter(i => i !== cb))
return () =>
(this.events[event] = (this.events[event] || []).filter(i => i !== cb))
}

@@ -12,0 +11,0 @@ })

{
"name": "nanoevents",
"version": "5.1.10",
"version": "5.1.11",
"description": "Simple and tiny (72 bytes) event emitter library",

@@ -24,2 +24,3 @@ "keywords": [

"types": "./index.d.ts",
"simple-pre-commit": "npx lint-staged",
"type": "module",

@@ -26,0 +27,0 @@ "main": "index.cjs",

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