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

Function isMatchingSignature

test/fixtures/snapshot/typescript.js:67275–67295  ·  view source on GitHub ↗
(source, target, partialMatch)

Source from the content-addressed store, hash-verified

67273 return compareTypes(getTypeOfSymbol(sourceProp), getTypeOfSymbol(targetProp));
67274 }
67275 function isMatchingSignature(source, target, partialMatch) {
67276 var sourceParameterCount = getParameterCount(source);
67277 var targetParameterCount = getParameterCount(target);
67278 var sourceMinArgumentCount = getMinArgumentCount(source);
67279 var targetMinArgumentCount = getMinArgumentCount(target);
67280 var sourceHasRestParameter = hasEffectiveRestParameter(source);
67281 var targetHasRestParameter = hasEffectiveRestParameter(target);
67282 // A source signature matches a target signature if the two signatures have the same number of required,
67283 // optional, and rest parameters.
67284 if (sourceParameterCount === targetParameterCount &&
67285 sourceMinArgumentCount === targetMinArgumentCount &&
67286 sourceHasRestParameter === targetHasRestParameter) {
67287 return true;
67288 }
67289 // A source signature partially matches a target signature if the target signature has no fewer required
67290 // parameters
67291 if (partialMatch && sourceMinArgumentCount <= targetMinArgumentCount) {
67292 return true;
67293 }
67294 return false;
67295 }
67296 /**
67297 * See signatureRelatedTo, compareSignaturesIdentical
67298 */

Callers 1

Calls 3

getParameterCountFunction · 0.85
getMinArgumentCountFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…