better-curry
Advanced tools
Comparing version 1.1.3 to 1.2.0
{ | ||
"name": "better-curry", | ||
"main": "index.js", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"authors": [ | ||
@@ -6,0 +6,0 @@ "Paulo Cesar <email@pocesar.e4ward.com>" |
@@ -31,3 +31,4 @@ (function (root, factory){ | ||
instead = function (xarg, index){ | ||
return remaining-- < 1 ? xarg : themArgs[rlen + i++] = xarg, themArgs[index]; | ||
var ret = remaining-- < -1 ? xarg : (themArgs[rlen + i++] = xarg, themArgs[index]); | ||
return ret; | ||
}; | ||
@@ -34,0 +35,0 @@ } |
{ | ||
"name": "better-curry", | ||
"version": "1.1.3", | ||
"version": "1.2.0", | ||
"description": "Forget Function.bind and func.apply(context, arguments), performance matters! For a better curry!", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -76,2 +76,15 @@ /*jshint evil:true */ | ||
it('should work with additional data', function(){ | ||
function base(a1, a2, a3){ | ||
return [a1, a2, a3, arguments.length.toString()]; | ||
} | ||
var curried = BetterCurry.predefine(base, ['1']); | ||
expect(curried(2,3)).to.eql(['1', 2, 3, '3']); | ||
curried = BetterCurry.predefine(base, ['1'], null, 4); | ||
expect(curried(2,3,'dummy','dummy','dummy')).to.eql(['1', 2, 3, '4']); | ||
}); | ||
it('should execute the function without a context', function (){ | ||
@@ -78,0 +91,0 @@ var |
Sorry, the diff of this file is not supported yet
350809
5946