GoScrobble/web/node_modules/arity-n
2022-04-25 14:48:54 +12:00
..
.editorconfig 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
.jshintrc 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
.npmignore 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
.travis.yml 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
0.js 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
1.js 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
2.js 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
3.js 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
4.js 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
5.js 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
LICENSE 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
N.js 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
package.json 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
README.md 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00
test.js 0.2.0 - Mid migration 2022-04-25 14:48:54 +12:00

arity-n

Build Status npm version

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