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

Function inferTypeFromPropertyElementExpression

test/fixtures/snapshot/typescript.js:157224–157240  ·  view source on GitHub ↗
(parent, node, usage)

Source from the content-addressed store, hash-verified

157222 usage.properties.set(name, propertyUsage);
157223 }
157224 function inferTypeFromPropertyElementExpression(parent, node, usage) {
157225 if (node === parent.argumentExpression) {
157226 usage.isNumberOrString = true;
157227 return;
157228 }
157229 else {
157230 var indexType = checker.getTypeAtLocation(parent.argumentExpression);
157231 var indexUsage = createEmptyUsage();
157232 calculateUsageOfNode(parent, indexUsage);
157233 if (indexType.flags & 296 /* TypeFlags.NumberLike */) {
157234 usage.numberIndex = indexUsage;
157235 }
157236 else {
157237 usage.stringIndex = indexUsage;
157238 }
157239 }
157240 }
157241 function inferTypeFromPropertyAssignment(assignment, usage) {
157242 var nodeWithRealType = ts.isVariableDeclaration(assignment.parent.parent) ?
157243 assignment.parent.parent :

Callers 1

calculateUsageOfNodeFunction · 0.85

Calls 2

createEmptyUsageFunction · 0.85
calculateUsageOfNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…