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

Function getContextualCallSignature

test/fixtures/snapshot/typescript.js:73264–73268  ·  view source on GitHub ↗
(type, node)

Source from the content-addressed store, hash-verified

73262 // If the given type is an object or union type with a single signature, and if that signature has at
73263 // least as many parameters as the given function, return the signature. Otherwise return undefined.
73264 function getContextualCallSignature(type, node) {
73265 var signatures = getSignaturesOfType(type, 0 /* SignatureKind.Call */);
73266 var applicableByArity = ts.filter(signatures, function (s) { return !isAritySmaller(s, node); });
73267 return applicableByArity.length === 1 ? applicableByArity[0] : getIntersectedSignatures(applicableByArity);
73268 }
73269 /** If the contextual signature has fewer parameters than the function expression, do not use it */
73270 function isAritySmaller(signature, target) {
73271 var targetParameterCount = 0;

Callers 2

getContextualSignatureFunction · 0.85

Calls 4

getSignaturesOfTypeFunction · 0.85
isAritySmallerFunction · 0.85
getIntersectedSignaturesFunction · 0.85
filterMethod · 0.65

Tested by

no test coverage detected