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

Function getBestMatchingType

test/fixtures/snapshot/typescript.js:66899–66906  ·  view source on GitHub ↗
(source, target, isRelatedTo)

Source from the content-addressed store, hash-verified

66897 return getPropertiesOfType(type).filter(function (targetProp) { return containsMissingType(getTypeOfSymbol(targetProp)); });
66898 }
66899 function getBestMatchingType(source, target, isRelatedTo) {
66900 if (isRelatedTo === void 0) { isRelatedTo = compareTypesAssignable; }
66901 return findMatchingDiscriminantType(source, target, isRelatedTo, /*skipPartial*/ true) ||
66902 findMatchingTypeReferenceOrTypeAliasReference(source, target) ||
66903 findBestTypeForObjectLiteral(source, target) ||
66904 findBestTypeForInvokable(source, target) ||
66905 findMostOverlappyType(source, target);
66906 }
66907 function discriminateTypeByDiscriminableItems(target, discriminators, related, defaultValue, skipPartial) {
66908 // undefined=unknown, true=discriminated, false=not discriminated
66909 // The state of each type progresses from left to right. Discriminated types stop at 'true'.

Callers 2

typeRelatedToSomeTypeFunction · 0.85

Tested by

no test coverage detected