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

Function getIndexInfosAtLocation

test/fixtures/snapshot/typescript.js:86531–86539  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

86529 }
86530 }
86531 function getIndexInfosAtLocation(node) {
86532 if (ts.isIdentifier(node) && ts.isPropertyAccessExpression(node.parent) && node.parent.name === node) {
86533 var keyType_1 = getLiteralTypeFromPropertyName(node);
86534 var objectType = getTypeOfExpression(node.parent.expression);
86535 var objectTypes = objectType.flags & 1048576 /* TypeFlags.Union */ ? objectType.types : [objectType];
86536 return ts.flatMap(objectTypes, function (t) { return ts.filter(getIndexInfosOfType(t), function (info) { return isApplicableIndexType(keyType_1, info.keyType); }); });
86537 }
86538 return undefined;
86539 }
86540 function getShorthandAssignmentValueSymbol(location) {
86541 if (location && location.kind === 297 /* SyntaxKind.ShorthandPropertyAssignment */) {
86542 return resolveEntityName(location.name, 111551 /* SymbolFlags.Value */ | 2097152 /* SymbolFlags.Alias */);

Callers 1

createTypeCheckerFunction · 0.85

Calls 6

getTypeOfExpressionFunction · 0.85
getIndexInfosOfTypeFunction · 0.85
isApplicableIndexTypeFunction · 0.85
flatMapMethod · 0.80
filterMethod · 0.65

Tested by

no test coverage detected