source: node_modules/ramda/src/internal/_curry3.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[d24f17c]1var _curry1 =
2/*#__PURE__*/
3require("./_curry1.js");
4
5var _curry2 =
6/*#__PURE__*/
7require("./_curry2.js");
8
9var _isPlaceholder =
10/*#__PURE__*/
11require("./_isPlaceholder.js");
12/**
13 * Optimized internal three-arity curry function.
14 *
15 * @private
16 * @category Function
17 * @param {Function} fn The function to curry.
18 * @return {Function} The curried function.
19 */
20
21
22function _curry3(fn) {
23 return function f3(a, b, c) {
24 switch (arguments.length) {
25 case 0:
26 return f3;
27
28 case 1:
29 return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {
30 return fn(a, _b, _c);
31 });
32
33 case 2:
34 return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {
35 return fn(_a, b, _c);
36 }) : _isPlaceholder(b) ? _curry2(function (_b, _c) {
37 return fn(a, _b, _c);
38 }) : _curry1(function (_c) {
39 return fn(a, b, _c);
40 });
41
42 default:
43 return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {
44 return fn(_a, _b, c);
45 }) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {
46 return fn(_a, b, _c);
47 }) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {
48 return fn(a, _b, _c);
49 }) : _isPlaceholder(a) ? _curry1(function (_a) {
50 return fn(_a, b, c);
51 }) : _isPlaceholder(b) ? _curry1(function (_b) {
52 return fn(a, _b, c);
53 }) : _isPlaceholder(c) ? _curry1(function (_c) {
54 return fn(a, b, _c);
55 }) : fn(a, b, c);
56 }
57 };
58}
59
60module.exports = _curry3;
Note: See TracBrowser for help on using the repository browser.