MCPcopy Create free account
hub / github.com/nodejs/node / findBestTypeForInvokable

Function findBestTypeForInvokable

test/fixtures/snapshot/typescript.js:89199–89206  ·  view source on GitHub ↗
(source, unionTarget)

Source from the content-addressed store, hash-verified

89197 }
89198 }
89199 function findBestTypeForInvokable(source, unionTarget) {
89200 var signatureKind = 0 /* SignatureKind.Call */;
89201 var hasSignatures = getSignaturesOfType(source, signatureKind).length > 0 ||
89202 (signatureKind = 1 /* SignatureKind.Construct */, getSignaturesOfType(source, signatureKind).length > 0);
89203 if (hasSignatures) {
89204 return ts.find(unionTarget.types, function (t) { return getSignaturesOfType(t, signatureKind).length > 0; });
89205 }
89206 }
89207 function findMostOverlappyType(source, unionTarget) {
89208 var bestMatch;
89209 if (!(source.flags & (131068 /* TypeFlags.Primitive */ | 406847488 /* TypeFlags.InstantiablePrimitive */))) {

Callers 1

getBestMatchingTypeFunction · 0.85

Calls 2

getSignaturesOfTypeFunction · 0.85
findMethod · 0.65

Tested by

no test coverage detected