MCPcopy
hub / github.com/microsoft/vscode-js-debug / mapValues

Function mapValues

src/common/objUtils.ts:56–67  ·  view source on GitHub ↗
(
  obj: Readonly<{ [key: string]: T }>,
  generator: (value: T, key: string) => R,
)

Source from the content-addressed store, hash-verified

54 * Maps the object values.
55 */
56export function mapValues<T, R>(
57 obj: Readonly<{ [key: string]: T }>,
58 generator: (value: T, key: string) => R,
59): { [key: string]: R } {
60 const next: { [key: string]: R } = {};
61 for (const key of Object.keys(obj)) {
62 const value = obj[key];
63 next[key] = generator(value, key);
64 }
65
66 return next;
67}
68
69/**
70 * Maps the object keys.

Callers 5

sanitizerMethod · 0.90
reportBootTelemetryMethod · 0.90
mapOutputFunction · 0.90
mapMethod · 0.90
dumpSourcesMethod · 0.90

Calls 1

keysMethod · 0.65

Tested by

no test coverage detected