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

Function getEffectiveRestType

test/fixtures/snapshot/typescript.js:77646–77657  ·  view source on GitHub ↗
(signature)

Source from the content-addressed store, hash-verified

77644 return false;
77645 }
77646 function getEffectiveRestType(signature) {
77647 if (signatureHasRestParameter(signature)) {
77648 var restType = getTypeOfSymbol(signature.parameters[signature.parameters.length - 1]);
77649 if (!isTupleType(restType)) {
77650 return restType;
77651 }
77652 if (restType.target.hasRestElement) {
77653 return sliceTupleType(restType, restType.target.fixedLength);
77654 }
77655 }
77656 return undefined;
77657 }
77658 function getNonArrayRestType(signature) {
77659 var restType = getEffectiveRestType(signature);
77660 return restType && !isArrayType(restType) && !isTypeAny(restType) && (getReducedType(restType).flags & 131072 /* TypeFlags.Never */) === 0 ? restType : undefined;

Callers 5

applyToParameterTypesFunction · 0.85
getRestTypeAtPositionFunction · 0.85
getNonArrayRestTypeFunction · 0.85

Calls 4

getTypeOfSymbolFunction · 0.85
isTupleTypeFunction · 0.85
sliceTupleTypeFunction · 0.85

Tested by

no test coverage detected