Socket
Socket
Sign inDemoInstall

tiny-emitter

Package Overview
Dependencies
0
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.11 to 0.1.12

9

index.js
function E () {
// Keep this empty so it's easier to inherit from
// Keep this empty so it's easier to inherit from
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)

@@ -7,3 +7,3 @@ }

E.prototype = {
on: function (name, callback, ctx) {
on: function (name, callback, ctx) {
var e = this.e || (this.e = {});

@@ -31,3 +31,3 @@

var data = [].slice.call(arguments, 1);
var evtArr = (this.e[name] || []).slice();
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
var i = 0;

@@ -57,2 +57,3 @@ var len = evtArr.length;

// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
(liveEvents.length)

@@ -66,2 +67,2 @@ ? e[name] = liveEvents

module.exports = E;
module.exports = E;
{
"name": "tiny-emitter",
"version": "0.1.11",
"version": "0.1.12",
"description": "A tiny (less than 1k) event emitter library",

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

@@ -190,2 +190,9 @@ var Emitter = require('../index.js');

t.end();
});
});
test('emitting event that has not been subscribed to yet', function (t) {
var emitter = new Emitter();
emitter.emit('some-event', 'some message');
t.end();
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc