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

Function sliceTupleType

test/fixtures/snapshot/typescript.js:61088–61095  ·  view source on GitHub ↗
(type, index, endSkipCount)

Source from the content-addressed store, hash-verified

61086 }
61087 }
61088 function sliceTupleType(type, index, endSkipCount) {
61089 if (endSkipCount === void 0) { endSkipCount = 0; }
61090 var target = type.target;
61091 var endIndex = getTypeReferenceArity(type) - endSkipCount;
61092 return index > target.fixedLength ? getRestArrayTypeOfTupleType(type) || createTupleType(ts.emptyArray) :
61093 createTupleType(getTypeArguments(type).slice(index, endIndex), target.elementFlags.slice(index, endIndex),
61094 /*readonly*/ false, target.labeledElementDeclarations && target.labeledElementDeclarations.slice(index, endIndex));
61095 }
61096 function getKnownKeysOfTupleType(type) {
61097 return getUnionType(ts.append(ts.arrayOf(type.target.fixedLength, function (i) { return getStringLiteralType("" + i); }), getIndexType(type.target.readonly ? globalReadonlyArrayType : globalArrayType)));
61098 }

Calls 5

getTypeReferenceArityFunction · 0.85
createTupleTypeFunction · 0.85
getTypeArgumentsFunction · 0.85
sliceMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…