12345678910111213141516171819202122 |
- "use strict";
- exports.__esModule = true;
- exports["default"] = curry;
- // Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
- // eslint-disable-next-line no-unused-vars
- // eslint-disable-next-line no-unused-vars
- // eslint-disable-next-line no-redeclare
- function curried(f, length, acc) {
- return function fn() {
- // eslint-disable-next-line prefer-rest-params
- var combined = acc.concat(Array.prototype.slice.call(arguments));
- return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
- };
- }
- // eslint-disable-next-line no-redeclare
- function curry(f) {
- // eslint-disable-line no-redeclare
- return curried(f, f.length, []);
- }
- module.exports = exports.default;
|