mirror of
https://github.com/cp6/my-idlers.git
synced 2024-11-16 23:42:32 +01:00
fd22b0bf58
V2 (Laravel re-make) |
||
---|---|---|
.. | ||
.editorconfig | ||
.jshintrc | ||
.npmignore | ||
.travis.yml | ||
0.js | ||
1.js | ||
2.js | ||
3.js | ||
4.js | ||
5.js | ||
LICENSE | ||
N.js | ||
package.json | ||
README.md | ||
test.js |
arity-n
Wraps a function with a function of a sertain arity.
Installation
npm install arity-n
Usage
function fn(a, b, c, d) {
}
var arityN = require('arity-n');
var newFn = arityN(fn, 3);
newFn.length; // => 3
var arity4 = require('arity-n/4');
var newFn = arity4(fn);
newFn.length; // => 4
// Max arity is 5.
var newFn = arityN(fn, 7);
newFn.length; // => 4