main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
839 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | var _curry1 =
|
---|
| 2 | /*#__PURE__*/
|
---|
| 3 | require("./_curry1.js");
|
---|
| 4 |
|
---|
| 5 | var _isPlaceholder =
|
---|
| 6 | /*#__PURE__*/
|
---|
| 7 | require("./_isPlaceholder.js");
|
---|
| 8 | /**
|
---|
| 9 | * Optimized internal two-arity curry function.
|
---|
| 10 | *
|
---|
| 11 | * @private
|
---|
| 12 | * @category Function
|
---|
| 13 | * @param {Function} fn The function to curry.
|
---|
| 14 | * @return {Function} The curried function.
|
---|
| 15 | */
|
---|
| 16 |
|
---|
| 17 |
|
---|
| 18 | function _curry2(fn) {
|
---|
| 19 | return function f2(a, b) {
|
---|
| 20 | switch (arguments.length) {
|
---|
| 21 | case 0:
|
---|
| 22 | return f2;
|
---|
| 23 |
|
---|
| 24 | case 1:
|
---|
| 25 | return _isPlaceholder(a) ? f2 : _curry1(function (_b) {
|
---|
| 26 | return fn(a, _b);
|
---|
| 27 | });
|
---|
| 28 |
|
---|
| 29 | default:
|
---|
| 30 | return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {
|
---|
| 31 | return fn(_a, b);
|
---|
| 32 | }) : _isPlaceholder(b) ? _curry1(function (_b) {
|
---|
| 33 | return fn(a, _b);
|
---|
| 34 | }) : fn(a, b);
|
---|
| 35 | }
|
---|
| 36 | };
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | module.exports = _curry2; |
---|
Note:
See
TracBrowser
for help on using the repository browser.