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

Function getConstituentTypeForKeyType

test/fixtures/snapshot/typescript.js:69507–69511  ·  view source on GitHub ↗
(unionType, keyType)

Source from the content-addressed store, hash-verified

69505 // Given a union type for which getKeyPropertyName returned a non-undefined result, return the constituent
69506 // that corresponds to the given key type for that property name.
69507 function getConstituentTypeForKeyType(unionType, keyType) {
69508 var _a;
69509 var result = (_a = unionType.constituentMap) === null || _a === void 0 ? void 0 : _a.get(getTypeId(getRegularTypeOfLiteralType(keyType)));
69510 return result !== unknownType ? result : undefined;
69511 }
69512 function getMatchingUnionConstituentForType(unionType, type) {
69513 var keyPropertyName = getKeyPropertyName(unionType);
69514 var propType = keyPropertyName && getTypeOfPropertyOfType(type, keyPropertyName);

Calls 3

getTypeIdFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…