Comparing version 1.1.1 to 1.1.2
@@ -1,6 +0,3 @@ | ||
/** | ||
* Events | ||
*/ | ||
function Events(target){ | ||
var events = {}, i, list, args, A = Array; | ||
var events = {}; | ||
target = target || this | ||
@@ -18,5 +15,5 @@ /** | ||
target.off = function(type, func){ | ||
list = events[type] || [] | ||
var list = events[type] || [], | ||
i = list.length = func ? list.length : 0 | ||
while(~--i<0) func == list[i].f && list.splice(i,1) | ||
while(i-->0) func == list[i].f && list.splice(i,1) | ||
} | ||
@@ -27,8 +24,9 @@ /** | ||
target.emit = function(){ | ||
args = A.apply([], arguments) | ||
list = events[args.shift()] || [] | ||
i = list.length | ||
for(j=0;j<i;j++) list[j].f.apply(list[j].c, args) | ||
var args = Array.apply([], arguments), | ||
list = events[args.shift()] || [], | ||
i = list.length, j | ||
for(j=0;j<i;j++) list[j].f.apply(list[j].c, args) | ||
}; | ||
} | ||
module.exports = Events | ||
var u, module, cjs = module != u; | ||
(cjs ? module : window)[(cjs ? 'exports' : 'Events')] = Events; |
@@ -1,1 +0,1 @@ | ||
function Events(a){var c,d,e,b={},f=Array;a=a||this,a.on=function(a,c,d){b[a]||(b[a]=[]),b[a].push({f:c,c:d})},a.off=function(a,e){for(d=b[a]||[],c=d.length=e?d.length:0;~--c<0;)e==d[c].f&&d.splice(c,1)},a.emit=function(){for(e=f.apply([],arguments),d=b[e.shift()]||[],c=d.length,j=0;c>j;j++)d[j].f.apply(d[j].c,e)}}module.exports=Events; | ||
function Events(n){var t={};n=n||this,n.on=function(n,e,o){t[n]||(t[n]=[]),t[n].push({f:e,c:o})},n.off=function(n,e){for(var o=t[n]||[],f=o.length=e?o.length:0;f-->0;)e==o[f].f&&o.splice(f,1)},n.emit=function(){var n,e=Array.apply([],arguments),o=t[e.shift()]||[],f=o.length;for(n=0;f>n;n++)o[n].f.apply(o[n].c,e)}}var u,module,cjs=module!=u;(cjs?module:window)[cjs?"exports":"Events"]=Events; |
{ | ||
"name": "minivents", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Tiny eventing for javascript", | ||
@@ -10,3 +10,4 @@ "main": "minivents.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "gulp" | ||
}, | ||
@@ -24,2 +25,7 @@ "repository": { | ||
}, | ||
"devDependencies": { | ||
"gulp": "~3.6.2", | ||
"gulp-uglify": "~0.3.0", | ||
"gulp-rename": "~1.2.0" | ||
}, | ||
"license": "MIT", | ||
@@ -26,0 +32,0 @@ "bugs": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7031
8
102
3