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

Function indexSignaturesRelatedTo

test/fixtures/snapshot/typescript.js:66797–66815  ·  view source on GitHub ↗
(source, target, sourceIsPrimitive, reportErrors, intersectionState)

Source from the content-addressed store, hash-verified

66795 return related;
66796 }
66797 function indexSignaturesRelatedTo(source, target, sourceIsPrimitive, reportErrors, intersectionState) {
66798 if (relation === identityRelation) {
66799 return indexSignaturesIdenticalTo(source, target);
66800 }
66801 var indexInfos = getIndexInfosOfType(target);
66802 var targetHasStringIndex = ts.some(indexInfos, function (info) { return info.keyType === stringType; });
66803 var result = -1 /* Ternary.True */;
66804 for (var _i = 0, indexInfos_5 = indexInfos; _i < indexInfos_5.length; _i++) {
66805 var targetInfo = indexInfos_5[_i];
66806 var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 /* TypeFlags.Any */ ? -1 /* Ternary.True */ :
66807 isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3 /* RecursionFlags.Both */, reportErrors) :
66808 typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
66809 if (!related) {
66810 return 0 /* Ternary.False */;
66811 }
66812 result &= related;
66813 }
66814 return result;
66815 }
66816 function typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState) {
66817 var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType);
66818 if (sourceInfo) {

Callers 2

structuredTypeRelatedToFunction · 0.85

Calls 7

getIndexInfosOfTypeFunction · 0.85
isGenericMappedTypeFunction · 0.85
isRelatedToFunction · 0.85
typeRelatedToIndexInfoFunction · 0.85
someMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…