Comparing version 1.0.0 to 1.0.1
15
index.js
"use strict"; | ||
module.exports = function (fn) { | ||
return function () { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return function () { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
var params = [].slice.call(args, 0); | ||
params = params.slice(1, 2).concat(params.slice(0, 1)).concat(params.slice(2)); | ||
return fn.apply(null, params); | ||
}; | ||
args = args.slice(1, 2).concat(args.slice(0, 1)).concat(args.slice(2)); | ||
return fn.apply(null, args); | ||
}; | ||
}; |
{ | ||
"name": "fj-flip", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Given a function, returns a new function with the first two arguments flipped.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,5 +13,5 @@ "use strict"; | ||
var flipDiv = flip(div); | ||
console.log(flipDiv.toString()); | ||
it("fj-flip", function () { | ||
assert.equal(flipDiv(3, 2), 0.6666666666666666); | ||
}); |
Sorry, the diff of this file is not supported yet
6133
47