MCPcopy
hub / github.com/webpack/webpack / mapObject

Function mapObject

lib/optimize/SplitChunksPlugin.js:237–248  ·  lib/optimize/SplitChunksPlugin.js::mapObject
(obj, fn)

Source from the content-addressed store, hash-verified

235 * @returns {T} result
236 */
237const mapObject = (obj, fn) => {
238 /** @type {T} */
239 const newObj = Object.create(null);
240 for (const key of Object.keys(obj)) {
241 newObj[/** @type {keyof T} */ (key)] = fn(
242 obj[/** @type {keyof T} */ (key)],
243 /** @type {keyof T} */
244 (key)
245 );
246 }
247 return newObj;
248};
249
250/**
251 * Checks whether this object is overlap.

Callers 1

applyMethod · 0.70

Calls 3

fnFunction · 0.70
keysMethod · 0.65
createMethod · 0.45

Tested by

no test coverage detected