UNPKG
dead-simple-curry
Version:
latest (1.1.2)
1.1.2
1.1.1
1.1.0
1.0.1
1.0.0
The simplest currying ever :)
github.com/msn0/dead-simple-curry
msn0/dead-simple-curry
dead-simple-curry
/
index.js
8 lines
(7 loc)
•
204 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
module
.
exports
=
function
(
fn
) {
return
function
curried
(
...args
) {
return
args.
length
>= fn.
length
? fn.
call
(
this
, ...args) :
(
...rest
) =>
curried.
call
(
this
, ...args, ...rest); }; };