mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 09:17:09 +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>
36 lines
995 B
JavaScript
36 lines
995 B
JavaScript
var _curry2 = /*#__PURE__*/require('./internal/_curry2');
|
|
|
|
var _reduce = /*#__PURE__*/require('./internal/_reduce');
|
|
|
|
var keys = /*#__PURE__*/require('./keys');
|
|
|
|
/**
|
|
* An Object-specific version of [`map`](#map). The function is applied to three
|
|
* arguments: *(value, key, obj)*. If only the value is significant, use
|
|
* [`map`](#map) instead.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @since v0.9.0
|
|
* @category Object
|
|
* @sig ((*, String, Object) -> *) -> Object -> Object
|
|
* @param {Function} fn
|
|
* @param {Object} obj
|
|
* @return {Object}
|
|
* @see R.map
|
|
* @example
|
|
*
|
|
* const xyz = { x: 1, y: 2, z: 3 };
|
|
* const prependKeyAndDouble = (num, key, obj) => key + (num * 2);
|
|
*
|
|
* R.mapObjIndexed(prependKeyAndDouble, xyz); //=> { x: 'x2', y: 'y4', z: 'z6' }
|
|
*/
|
|
|
|
|
|
var mapObjIndexed = /*#__PURE__*/_curry2(function mapObjIndexed(fn, obj) {
|
|
return _reduce(function (acc, key) {
|
|
acc[key] = fn(obj[key], key, obj);
|
|
return acc;
|
|
}, {}, keys(obj));
|
|
});
|
|
module.exports = mapObjIndexed; |