MCPcopy Index your code
hub / github.com/nodejs/node / arrayToMap

Function arrayToMap

test/fixtures/snapshot/typescript.js:1556–1566  ·  view source on GitHub ↗
(array, makeKey, makeValue)

Source from the content-addressed store, hash-verified

1554 }
1555 ts.equalOwnProperties = equalOwnProperties;
1556 function arrayToMap(array, makeKey, makeValue) {
1557 if (makeValue === void 0) { makeValue = identity; }
1558 var result = new ts.Map();
1559 for (var _i = 0, array_6 = array; _i < array_6.length; _i++) {
1560 var value = array_6[_i];
1561 var key = makeKey(value);
1562 if (key !== undefined)
1563 result.set(key, makeValue(value));
1564 }
1565 return result;
1566 }
1567 ts.arrayToMap = arrayToMap;
1568 function arrayToNumericMap(array, makeKey, makeValue) {
1569 if (makeValue === void 0) { makeValue = identity; }

Callers

nothing calls this directly

Calls 2

makeKeyFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected