1 | ;
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports["default"] = curry;
|
5 | // Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
|
6 | // eslint-disable-next-line no-unused-vars
|
7 | // eslint-disable-next-line no-unused-vars
|
8 | // eslint-disable-next-line no-redeclare
|
9 | function curried(f, length, acc) {
|
10 | return function fn() {
|
11 | // eslint-disable-next-line prefer-rest-params
|
12 | var combined = acc.concat(Array.prototype.slice.call(arguments));
|
13 | return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
|
14 | };
|
15 | }
|
16 |
|
17 | // eslint-disable-next-line no-redeclare
|
18 | function curry(f) {
|
19 | // eslint-disable-line no-redeclare
|
20 | return curried(f, f.length, []);
|
21 | }
|
22 | module.exports = exports.default; |
\ | No newline at end of file |