mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-10 05:35:05 +08:00
DISABLE_THIRD_PARTY_CHECK=new npm module causes package-lock change We can get rid of a custom script and use ESLint for these rules. Additionally this means editors will highlight the issue in the editor. Change-Id: I552b52e7f07b4e7430b3f685dbc3b5fad36ffff2 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2052167 Reviewed-by: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
import _curry3 from './internal/_curry3.js';
|
|
import equals from './equals.js';
|
|
import path from './path.js';
|
|
|
|
/**
|
|
* Determines whether a nested path on an object has a specific value, in
|
|
* [`R.equals`](#equals) terms. Most likely used to filter a list.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.7.0
|
|
* @category Relation
|
|
* @typedefn Idx = String | Int
|
|
* @sig [Idx] -> a -> {a} -> Boolean
|
|
* @param {Array} path The path of the nested property to use
|
|
* @param {*} val The value to compare the nested property with
|
|
* @param {Object} obj The object to check the nested property in
|
|
* @return {Boolean} `true` if the value equals the nested object property,
|
|
* `false` otherwise.
|
|
* @example
|
|
*
|
|
* const user1 = { address: { zipCode: 90210 } };
|
|
* const user2 = { address: { zipCode: 55555 } };
|
|
* const user3 = { name: 'Bob' };
|
|
* const users = [ user1, user2, user3 ];
|
|
* const isFamous = R.pathEq(['address', 'zipCode'], 90210);
|
|
* R.filter(isFamous, users); //=> [ user1 ]
|
|
*/
|
|
var pathEq = /*#__PURE__*/_curry3(function pathEq(_path, val, obj) {
|
|
return equals(path(_path, obj), val);
|
|
});
|
|
export default pathEq; |