1 | var _arity =
|
2 | /*#__PURE__*/
|
3 | require("./internal/_arity");
|
4 |
|
5 | var _pipeP =
|
6 | /*#__PURE__*/
|
7 | require("./internal/_pipeP");
|
8 |
|
9 | var reduce =
|
10 | /*#__PURE__*/
|
11 | require("./reduce");
|
12 |
|
13 | var tail =
|
14 | /*#__PURE__*/
|
15 | require("./tail");
|
16 | /**
|
17 | * Performs left-to-right composition of one or more Promise-returning
|
18 | * functions. The first argument may have any arity; the remaining arguments
|
19 | * must be unary.
|
20 | *
|
21 | * @func
|
22 | * @memberOf R
|
23 | * @since v0.10.0
|
24 | * @category Function
|
25 | * @sig ((a -> Promise b), (b -> Promise c), ..., (y -> Promise z)) -> (a -> Promise z)
|
26 | * @param {...Function} functions
|
27 | * @return {Function}
|
28 | * @see R.composeP
|
29 | * @deprecated since v0.26.0
|
30 | * @example
|
31 | *
|
32 | * // followersForUser :: String -> Promise [User]
|
33 | * const followersForUser = R.pipeP(db.getUserById, db.getFollowers);
|
34 | */
|
35 |
|
36 |
|
37 | function pipeP() {
|
38 | if (arguments.length === 0) {
|
39 | throw new Error('pipeP requires at least one argument');
|
40 | }
|
41 |
|
42 | return _arity(arguments[0].length, reduce(_pipeP, arguments[0], tail(arguments)));
|
43 | }
|
44 |
|
45 | module.exports = pipeP; |
\ | No newline at end of file |