mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 01:38:07 +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>
30 lines
1.0 KiB
JavaScript
30 lines
1.0 KiB
JavaScript
import _curry3 from './internal/_curry3.js';
|
|
import adjust from './adjust.js';
|
|
import always from './always.js';
|
|
|
|
/**
|
|
* Returns a new copy of the array with the element at the provided index
|
|
* replaced with the given value.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.14.0
|
|
* @category List
|
|
* @sig Number -> a -> [a] -> [a]
|
|
* @param {Number} idx The index to update.
|
|
* @param {*} x The value to exist at the given index of the returned array.
|
|
* @param {Array|Arguments} list The source array-like object to be updated.
|
|
* @return {Array} A copy of `list` with the value at index `idx` replaced with `x`.
|
|
* @see R.adjust
|
|
* @example
|
|
*
|
|
* R.update(1, '_', ['a', 'b', 'c']); //=> ['a', '_', 'c']
|
|
* R.update(-1, '_', ['a', 'b', 'c']); //=> ['a', 'b', '_']
|
|
* @symb R.update(-1, a, [b, c]) = [b, a]
|
|
* @symb R.update(0, a, [b, c]) = [a, c]
|
|
* @symb R.update(1, a, [b, c]) = [b, a]
|
|
*/
|
|
var update = /*#__PURE__*/_curry3(function update(idx, x, list) {
|
|
return adjust(idx, always(x), list);
|
|
});
|
|
export default update; |