mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 01:38:07 +08:00
Major update breaking changes: - ESLint 7.0.0 (https://eslint.org/docs/user-guide/migrating-to-7.0.0) now includes .eslint.rc.js in its list, which is fine for us. Other changes are not applicable for us. - eslint-plugin-mocha (https://github.com/lo1tuma/eslint-plugin-mocha/blob/master/CHANGELOG.md#700-may-13-2020) drops support for ESLint <7, but this CL updates to 7+. Other changes are not applicable for us. DISABLE_THIRD_PARTY_CHECK=Updating ESLint R=petermarshall@chromium.org Change-Id: I7760e084ef87f73a92f9ea4e075fb4c065047f5a Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2534873 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
import _curry2 from "./internal/_curry2.js";
|
|
import map from "./map.js";
|
|
import prop from "./prop.js";
|
|
/**
|
|
* Returns a new list by plucking the same named property off all objects in
|
|
* the list supplied.
|
|
*
|
|
* `pluck` will work on
|
|
* any [functor](https://github.com/fantasyland/fantasy-land#functor) in
|
|
* addition to arrays, as it is equivalent to `R.map(R.prop(k), f)`.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.1.0
|
|
* @category List
|
|
* @sig Functor f => k -> f {k: v} -> f v
|
|
* @param {Number|String} key The key name to pluck off of each object.
|
|
* @param {Array} f The array or functor to consider.
|
|
* @return {Array} The list of values for the given key.
|
|
* @see R.props
|
|
* @example
|
|
*
|
|
* var getAges = R.pluck('age');
|
|
* getAges([{name: 'fred', age: 29}, {name: 'wilma', age: 27}]); //=> [29, 27]
|
|
*
|
|
* R.pluck(0, [[1, 2], [3, 4]]); //=> [1, 3]
|
|
* R.pluck('val', {a: {val: 3}, b: {val: 5}}); //=> {a: 3, b: 5}
|
|
* @symb R.pluck('x', [{x: 1, y: 2}, {x: 3, y: 4}, {x: 5, y: 6}]) = [1, 3, 5]
|
|
* @symb R.pluck(0, [[1, 2], [3, 4], [5, 6]]) = [1, 3, 5]
|
|
*/
|
|
|
|
var pluck =
|
|
/*#__PURE__*/
|
|
_curry2(function pluck(p, list) {
|
|
return map(prop(p), list);
|
|
});
|
|
|
|
export default pluck; |