1 | var _map =
|
2 | /*#__PURE__*/
|
3 | require("./internal/_map");
|
4 |
|
5 | var identity =
|
6 | /*#__PURE__*/
|
7 | require("./identity");
|
8 |
|
9 | var pickAll =
|
10 | /*#__PURE__*/
|
11 | require("./pickAll");
|
12 |
|
13 | var useWith =
|
14 | /*#__PURE__*/
|
15 | require("./useWith");
|
16 | /**
|
17 | * Reasonable analog to SQL `select` statement.
|
18 | *
|
19 | * @func
|
20 | * @memberOf R
|
21 | * @since v0.1.0
|
22 | * @category Object
|
23 | * @category Relation
|
24 | * @sig [k] -> [{k: v}] -> [{k: v}]
|
25 | * @param {Array} props The property names to project
|
26 | * @param {Array} objs The objects to query
|
27 | * @return {Array} An array of objects with just the `props` properties.
|
28 | * @example
|
29 | *
|
30 | * const abby = {name: 'Abby', age: 7, hair: 'blond', grade: 2};
|
31 | * const fred = {name: 'Fred', age: 12, hair: 'brown', grade: 7};
|
32 | * const kids = [abby, fred];
|
33 | * R.project(['name', 'grade'], kids); //=> [{name: 'Abby', grade: 2}, {name: 'Fred', grade: 7}]
|
34 | */
|
35 |
|
36 |
|
37 | var project =
|
38 | /*#__PURE__*/
|
39 | useWith(_map, [pickAll, identity]); // passing `identity` gives correct arity
|
40 |
|
41 | module.exports = project; |
\ | No newline at end of file |