1 | var _curry1 =
|
2 | /*#__PURE__*/
|
3 | require("./internal/_curry1");
|
4 |
|
5 | var converge =
|
6 | /*#__PURE__*/
|
7 | require("./converge");
|
8 | /**
|
9 | * juxt applies a list of functions to a list of values.
|
10 | *
|
11 | * @func
|
12 | * @memberOf R
|
13 | * @since v0.19.0
|
14 | * @category Function
|
15 | * @sig [(a, b, ..., m) -> n] -> ((a, b, ..., m) -> [n])
|
16 | * @param {Array} fns An array of functions
|
17 | * @return {Function} A function that returns a list of values after applying each of the original `fns` to its parameters.
|
18 | * @see R.applySpec
|
19 | * @example
|
20 | *
|
21 | * const getRange = R.juxt([Math.min, Math.max]);
|
22 | * getRange(3, 4, 9, -3); //=> [-3, 9]
|
23 | * @symb R.juxt([f, g, h])(a, b) = [f(a, b), g(a, b), h(a, b)]
|
24 | */
|
25 |
|
26 |
|
27 | var juxt =
|
28 | /*#__PURE__*/
|
29 | _curry1(function juxt(fns) {
|
30 | return converge(function () {
|
31 | return Array.prototype.slice.call(arguments, 0);
|
32 | }, fns);
|
33 | });
|
34 |
|
35 | module.exports = juxt; |
\ | No newline at end of file |