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 1.0.7 to 1.0.8

3

CHANGELOG.md
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 1.0.8
* Reduce size (by Vladlen Grachev).
## 1.0.7

@@ -5,0 +8,0 @@ * Reduce size (by Vladlen Grachev).

21

index.js

@@ -52,8 +52,5 @@ (

emit: function emit (event) {
// event variable is reused and repurposed, now it's an array of handlers
event = this.events[event]
if (!event || !event[0]) return // event[0] === Array.isArray(event)
var args = event.slice.call(arguments, 1)
event.slice().map(function (i) {
var args = [].slice.call(arguments, 1)
// Array.prototype.call() returns empty array if context is not array-like
;[].slice.call(this.events[event] || []).filter(function (i) {
i.apply(this, args) // this === global or window

@@ -88,12 +85,10 @@ })

// event variable is reused and repurposed, now it's an array of handlers
event = this.events[event] = this.events[event] || []
event.push(cb)
(this.events[event] = this.events[event] || []).push(cb)
return function () {
// a.splice(i >>> 0, 1) === if (i !== -1) a.splice(i, 1)
// -1 >>> 0 === 0xFFFFFFFF, max possible array length
event.splice(event.indexOf(cb) >>> 0, 1)
}
this.events[event] = this.events[event].filter(function (i) {
return i !== cb
})
}.bind(this)
}
}
{
"name": "nanoevents",
"version": "1.0.7",
"description": "Simple and tiny (115 bytes) event emitter library",
"version": "1.0.8",
"description": "Simple and tiny (101 bytes) event emitter library",
"keywords": [

@@ -21,3 +21,8 @@ "EventEmitter",

"node": ">=4.0.0"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}

@@ -6,3 +6,3 @@ # Nano Events

* No Node.js [EventEmitter] compatibility.
* Only 115 bytes (minified and gzipped). It uses [Size Limit] to control size.
* Only 101 bytes (minified and gzipped). It uses [Size Limit] to control size.
* `on` method returns `unbind` function. You don’t need to save

@@ -9,0 +9,0 @@ callback to variable for `removeListener`.

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