You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Björn
b963b3396c
|
4 years ago | |
---|---|---|
.. | ||
.editorconfig | 4 years ago | |
.jshintrc | 4 years ago | |
.npmignore | 4 years ago | |
.travis.yml | 4 years ago | |
0.js | 4 years ago | |
1.js | 4 years ago | |
2.js | 4 years ago | |
3.js | 4 years ago | |
4.js | 4 years ago | |
5.js | 4 years ago | |
LICENSE | 4 years ago | |
N.js | 4 years ago | |
README.md | 4 years ago | |
package.json | 4 years ago | |
test.js | 4 years ago |
README.md
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