UNPKG
uncurrify
Version:
latest (2.1.0)
2.1.0
2.0.2
2.0.1
2.0.0
1.0.1
1.0.0
uncurry function that was curried before
github.com/coderaiser/uncurrify
coderaiser/uncurrify
uncurrify
/
lib
/
uncurrify.js
19 lines
(14 loc)
•
315 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict'
;
module
.
exports
= uncurrify;
function
uncurrify
(
fn
) {
check
(fn);
return
(
...args
) =>
{
return
args.
reduce
(
(
fn, arg
) =>
{
return
fn
(arg); }, fn); }; }
function
check
(
fn
) {
if
(
typeof
fn !==
'function'
)
throw
Error
(
'fn should be function!'
); }