1 | var _curry2 =
|
2 | /*#__PURE__*/
|
3 | require("./internal/_curry2");
|
4 |
|
5 | var path =
|
6 | /*#__PURE__*/
|
7 | require("./path");
|
8 | /**
|
9 | * Acts as multiple `prop`: array of keys in, array of values out. Preserves
|
10 | * order.
|
11 | *
|
12 | * @func
|
13 | * @memberOf R
|
14 | * @since v0.1.0
|
15 | * @category Object
|
16 | * @sig [k] -> {k: v} -> [v]
|
17 | * @param {Array} ps The property names to fetch
|
18 | * @param {Object} obj The object to query
|
19 | * @return {Array} The corresponding values or partially applied function.
|
20 | * @example
|
21 | *
|
22 | * R.props(['x', 'y'], {x: 1, y: 2}); //=> [1, 2]
|
23 | * R.props(['c', 'a', 'b'], {b: 2, a: 1}); //=> [undefined, 1, 2]
|
24 | *
|
25 | * const fullName = R.compose(R.join(' '), R.props(['first', 'last']));
|
26 | * fullName({last: 'Bullet-Tooth', age: 33, first: 'Tony'}); //=> 'Tony Bullet-Tooth'
|
27 | */
|
28 |
|
29 |
|
30 | var props =
|
31 | /*#__PURE__*/
|
32 | _curry2(function props(ps, obj) {
|
33 | return ps.map(function (p) {
|
34 | return path([p], obj);
|
35 | });
|
36 | });
|
37 |
|
38 | module.exports = props; |
\ | No newline at end of file |