mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-11 14:14:36 +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>
33 lines
986 B
JavaScript
33 lines
986 B
JavaScript
import _curry1 from './internal/_curry1.js';
|
|
import assocPath from './assocPath.js';
|
|
import lens from './lens.js';
|
|
import path from './path.js';
|
|
|
|
/**
|
|
* Returns a lens whose focus is the specified path.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.19.0
|
|
* @category Object
|
|
* @typedefn Idx = String | Int
|
|
* @typedefn Lens s a = Functor f => (a -> f a) -> s -> f s
|
|
* @sig [Idx] -> Lens s a
|
|
* @param {Array} path The path to use.
|
|
* @return {Lens}
|
|
* @see R.view, R.set, R.over
|
|
* @example
|
|
*
|
|
* const xHeadYLens = R.lensPath(['x', 0, 'y']);
|
|
*
|
|
* R.view(xHeadYLens, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});
|
|
* //=> 2
|
|
* R.set(xHeadYLens, 1, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});
|
|
* //=> {x: [{y: 1, z: 3}, {y: 4, z: 5}]}
|
|
* R.over(xHeadYLens, R.negate, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});
|
|
* //=> {x: [{y: -2, z: 3}, {y: 4, z: 5}]}
|
|
*/
|
|
var lensPath = /*#__PURE__*/_curry1(function lensPath(p) {
|
|
return lens(path(p), assocPath(p));
|
|
});
|
|
export default lensPath; |