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

Function applyToParameterTypes

test/fixtures/snapshot/typescript.js:68001–68021  ·  view source on GitHub ↗
(source, target, callback)

Source from the content-addressed store, hash-verified

67999 });
68000 }
68001 function applyToParameterTypes(source, target, callback) {
68002 var sourceCount = getParameterCount(source);
68003 var targetCount = getParameterCount(target);
68004 var sourceRestType = getEffectiveRestType(source);
68005 var targetRestType = getEffectiveRestType(target);
68006 var targetNonRestCount = targetRestType ? targetCount - 1 : targetCount;
68007 var paramCount = sourceRestType ? targetNonRestCount : Math.min(sourceCount, targetNonRestCount);
68008 var sourceThisType = getThisTypeOfSignature(source);
68009 if (sourceThisType) {
68010 var targetThisType = getThisTypeOfSignature(target);
68011 if (targetThisType) {
68012 callback(sourceThisType, targetThisType);
68013 }
68014 }
68015 for (var i = 0; i < paramCount; i++) {
68016 callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i));
68017 }
68018 if (targetRestType) {
68019 callback(getRestTypeAtPosition(source, paramCount), targetRestType);
68020 }
68021 }
68022 function applyToReturnTypes(source, target, callback) {
68023 var sourceTypePredicate = getTypePredicateOfSignature(source);
68024 var targetTypePredicate = getTypePredicateOfSignature(target);

Calls 7

getParameterCountFunction · 0.85
getEffectiveRestTypeFunction · 0.85
getThisTypeOfSignatureFunction · 0.85
getTypeAtPositionFunction · 0.85
getRestTypeAtPositionFunction · 0.85
callbackFunction · 0.70
minMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…