forked from waja/action-debian-package
45 lines
1,019 B
JavaScript
45 lines
1,019 B
JavaScript
var _arity =
|
|
/*#__PURE__*/
|
|
require("./internal/_arity");
|
|
|
|
var _pipeP =
|
|
/*#__PURE__*/
|
|
require("./internal/_pipeP");
|
|
|
|
var reduce =
|
|
/*#__PURE__*/
|
|
require("./reduce");
|
|
|
|
var tail =
|
|
/*#__PURE__*/
|
|
require("./tail");
|
|
/**
|
|
* Performs left-to-right composition of one or more Promise-returning
|
|
* functions. The first argument may have any arity; the remaining arguments
|
|
* must be unary.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.10.0
|
|
* @category Function
|
|
* @sig ((a -> Promise b), (b -> Promise c), ..., (y -> Promise z)) -> (a -> Promise z)
|
|
* @param {...Function} functions
|
|
* @return {Function}
|
|
* @see R.composeP
|
|
* @deprecated since v0.26.0
|
|
* @example
|
|
*
|
|
* // followersForUser :: String -> Promise [User]
|
|
* const followersForUser = R.pipeP(db.getUserById, db.getFollowers);
|
|
*/
|
|
|
|
|
|
function pipeP() {
|
|
if (arguments.length === 0) {
|
|
throw new Error('pipeP requires at least one argument');
|
|
}
|
|
|
|
return _arity(arguments[0].length, reduce(_pipeP, arguments[0], tail(arguments)));
|
|
}
|
|
|
|
module.exports = pipeP; |