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

Function isApplicableIndexType

test/fixtures/snapshot/typescript.js:59474–59480  ·  view source on GitHub ↗
(source, target)

Source from the content-addressed store, hash-verified

59472 undefined;
59473 }
59474 function isApplicableIndexType(source, target) {
59475 // A 'string' index signature applies to types assignable to 'string' or 'number', and a 'number' index
59476 // signature applies to types assignable to 'number', `${number}` and numeric string literal types.
59477 return isTypeAssignableTo(source, target) ||
59478 target === stringType && isTypeAssignableTo(source, numberType) ||
59479 target === numberType && (source === numericStringType || !!(source.flags & 128 /* TypeFlags.StringLiteral */) && ts.isNumericLiteralName(source.value));
59480 }
59481 function getIndexInfosOfStructuredType(type) {
59482 if (type.flags & 3670016 /* TypeFlags.StructuredType */) {
59483 var resolved = resolveStructuredTypeMembers(type);

Callers 5

findApplicableIndexInfoFunction · 0.85
getApplicableIndexInfosFunction · 0.85
inferFromIndexTypesFunction · 0.85
getIndexInfosAtLocationFunction · 0.85

Calls 1

isTypeAssignableToFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…