Socket
Socket
Sign inDemoInstall

minivents

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

dump.rdb

2

bower.json
{
"name": "minivents",
"version": "2.0.0",
"version": "2.0.1",
"homepage": "https://github.com/allouis/minivents",

@@ -5,0 +5,0 @@ "authors": [

define([], function() { return function Events(target){
var events = {}, empty = [], list, j, i;
var events = {}, empty = [];
target = target || this

@@ -15,4 +15,4 @@ /**

type || (events = {})
list = events[type] || empty,
i = list.length = func ? list.length : 0
var list = events[type] || empty,
i = list.length = func ? list.length : 0;
while(i--) func == list[i][0] && list.splice(i,1)

@@ -24,5 +24,5 @@ }

target.emit = function(type){
list = events[type] || empty; i=0
var list = events[type] || empty, i=0, j;
while(j=list[i++]) j[0].apply(j[1], empty.slice.call(arguments, 1))
};
}; });

@@ -1,1 +0,1 @@

define([],function(){return function(n){var t,f,i,e={},o=[];n=n||this,n.on=function(n,t,f){(e[n]=e[n]||[]).push([t,f])},n.off=function(n,f){for(n||(e={}),t=e[n]||o,i=t.length=f?t.length:0;i--;)f==t[i][0]&&t.splice(i,1)},n.emit=function(n){for(t=e[n]||o,i=0;f=t[i++];)f[0].apply(f[1],o.slice.call(arguments,1))}}});
define([],function(){return function(n){var t={},f=[];n=n||this,n.on=function(n,f,i){(t[n]=t[n]||[]).push([f,i])},n.off=function(n,i){n||(t={});for(var e=t[n]||f,o=e.length=i?e.length:0;o--;)i==e[o][0]&&e.splice(o,1)},n.emit=function(n){for(var i,e=t[n]||f,o=0;i=e[o++];)i[0].apply(i[1],f.slice.call(arguments,1))}}});
module.exports = function Events(target){
var events = {}, empty = [], list, j, i;
var events = {}, empty = [];
target = target || this

@@ -15,4 +15,4 @@ /**

type || (events = {})
list = events[type] || empty,
i = list.length = func ? list.length : 0
var list = events[type] || empty,
i = list.length = func ? list.length : 0;
while(i--) func == list[i][0] && list.splice(i,1)

@@ -24,5 +24,5 @@ }

target.emit = function(type){
list = events[type] || empty; i=0
var list = events[type] || empty, i=0, j;
while(j=list[i++]) j[0].apply(j[1], empty.slice.call(arguments, 1))
};
};

@@ -1,1 +0,1 @@

module.exports=function(n){var o,t,e,f={},i=[];n=n||this,n.on=function(n,o,t){(f[n]=f[n]||[]).push([o,t])},n.off=function(n,t){for(n||(f={}),o=f[n]||i,e=o.length=t?o.length:0;e--;)t==o[e][0]&&o.splice(e,1)},n.emit=function(n){for(o=f[n]||i,e=0;t=o[e++];)t[0].apply(t[1],i.slice.call(arguments,1))}};
module.exports=function(n){var o={},t=[];n=n||this,n.on=function(n,t,e){(o[n]=o[n]||[]).push([t,e])},n.off=function(n,e){n||(o={});for(var f=o[n]||t,i=f.length=e?f.length:0;i--;)e==f[i][0]&&f.splice(i,1)},n.emit=function(n){for(var e,f=o[n]||t,i=0;e=f[i++];)e[0].apply(e[1],t.slice.call(arguments,1))}};
function Events(target){
var events = {}, empty = [], list, j, i;
var events = {}, empty = [];
target = target || this

@@ -15,4 +15,4 @@ /**

type || (events = {})
list = events[type] || empty,
i = list.length = func ? list.length : 0
var list = events[type] || empty,
i = list.length = func ? list.length : 0;
while(i--) func == list[i][0] && list.splice(i,1)

@@ -24,5 +24,5 @@ }

target.emit = function(type){
list = events[type] || empty; i=0
var list = events[type] || empty, i=0, j;
while(j=list[i++]) j[0].apply(j[1], empty.slice.call(arguments, 1))
};
};

@@ -1,1 +0,1 @@

function Events(n){var t,f,i,o={},c=[];n=n||this,n.on=function(n,t,f){(o[n]=o[n]||[]).push([t,f])},n.off=function(n,f){for(n||(o={}),t=o[n]||c,i=t.length=f?t.length:0;i--;)f==t[i][0]&&t.splice(i,1)},n.emit=function(n){for(t=o[n]||c,i=0;f=t[i++];)f[0].apply(f[1],c.slice.call(arguments,1))}}
function Events(n){var t={},f=[];n=n||this,n.on=function(n,f,i){(t[n]=t[n]||[]).push([f,i])},n.off=function(n,i){n||(t={});for(var o=t[n]||f,c=o.length=i?o.length:0;c--;)i==o[c][0]&&o.splice(c,1)},n.emit=function(n){for(var i,o=t[n]||f,c=0;i=o[c++];)i[0].apply(i[1],f.slice.call(arguments,1))}}
{
"name": "minivents",
"version": "2.0.0",
"version": "2.0.1",
"description": "Tiny eventing for javascript",

@@ -5,0 +5,0 @@ "main": "dist/minivents.commonjs.js",

function Events(target){
var events = {}, empty = [], list, j, i;
var events = {}, empty = [];
target = target || this

@@ -15,4 +15,4 @@ /**

type || (events = {})
list = events[type] || empty,
i = list.length = func ? list.length : 0
var list = events[type] || empty,
i = list.length = func ? list.length : 0;
while(i--) func == list[i][0] && list.splice(i,1)

@@ -24,5 +24,5 @@ }

target.emit = function(type){
list = events[type] || empty; i=0
var list = events[type] || empty, i=0, j;
while(j=list[i++]) j[0].apply(j[1], empty.slice.call(arguments, 1))
};
}

@@ -129,2 +129,3 @@ var assert = require('assert'),

f3 = function () { called++ };
bus.on('ping', f1);

@@ -155,2 +156,25 @@ bus.on('ping', f2);

it('should result in registered callbacks being invoked with cascade', function () {
var bus = new Events(),
called = 0,
cascade = false,
f1 = function () { called++ },
f2 = function () { called++ },
f3 = function () { called++ },
f4 = function () { bus.emit('cascade'); },
f5 = function () { called++ },
f6 = function () { cascade = true; };
bus.on('ping', f1);
bus.on('ping', f2);
bus.on('ping', f3);
bus.on('ping', f4);
bus.on('ping', f5);
bus.on('cascade', f6);
bus.emit('ping');
assert.equal(called, 4);
assert.equal(cascade, true);
});
});
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc