UNPKG

1.14 kBJavaScriptView Raw
1var _concat =
2/*#__PURE__*/
3require("./internal/_concat");
4
5var _createPartialApplicator =
6/*#__PURE__*/
7require("./internal/_createPartialApplicator");
8
9var flip =
10/*#__PURE__*/
11require("./flip");
12/**
13 * Takes a function `f` and a list of arguments, and returns a function `g`.
14 * When applied, `g` returns the result of applying `f` to the arguments
15 * provided to `g` followed by the arguments provided initially.
16 *
17 * @func
18 * @memberOf R
19 * @since v0.10.0
20 * @category Function
21 * @sig ((a, b, c, ..., n) -> x) -> [d, e, f, ..., n] -> ((a, b, c, ...) -> x)
22 * @param {Function} f
23 * @param {Array} args
24 * @return {Function}
25 * @see R.partial
26 * @example
27 *
28 * const greet = (salutation, title, firstName, lastName) =>
29 * salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';
30 *
31 * const greetMsJaneJones = R.partialRight(greet, ['Ms.', 'Jane', 'Jones']);
32 *
33 * greetMsJaneJones('Hello'); //=> 'Hello, Ms. Jane Jones!'
34 * @symb R.partialRight(f, [a, b])(c, d) = f(c, d, a, b)
35 */
36
37
38var partialRight =
39/*#__PURE__*/
40_createPartialApplicator(
41/*#__PURE__*/
42flip(_concat));
43
44module.exports = partialRight;
\No newline at end of file