npm.io
1.0.2 • Published 9 years ago

curry-n

Licence
MIT
Version
1.0.2
Deps
0
Vulns
0
Weekly
0

curry-n

Travis Build NPM Version Bithound Status License

Curry a function with specified arity

Install

npm i -S curry-n

Usage

const curryN = require('curry-n')

const curried = curryN(3, function(...args) {
    console.log(...args)
})

curried(1, 2, 3)
curried(1)(2)(3)

const curriedThis = curryN(3, function(...args) {
    console.log(this, ...args)
})

curriedThis.call({some: 'this arg'})(1)(2, 3)
curriedThis(1, 2).call('some this arg')(3)

Dev

git clone https://github.com/nhz-io/curry-n
cd curry-n
npm i
npm start
Coverage
npm run coverage
npm run report

License

MIT

Keywords