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

Function getElementTypeOfSliceOfTupleType

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

Source from the content-addressed store, hash-verified

67558 return restType && createArrayType(restType);
67559 }
67560 function getElementTypeOfSliceOfTupleType(type, index, endSkipCount, writing) {
67561 if (endSkipCount === void 0) { endSkipCount = 0; }
67562 if (writing === void 0) { writing = false; }
67563 var length = getTypeReferenceArity(type) - endSkipCount;
67564 if (index < length) {
67565 var typeArguments = getTypeArguments(type);
67566 var elementTypes = [];
67567 for (var i = index; i < length; i++) {
67568 var t = typeArguments[i];
67569 elementTypes.push(type.target.elementFlags[i] & 8 /* ElementFlags.Variadic */ ? getIndexedAccessType(t, numberType) : t);
67570 }
67571 return writing ? getIntersectionType(elementTypes) : getUnionType(elementTypes);
67572 }
67573 return undefined;
67574 }
67575 function isTupleTypeStructureMatching(t1, t2) {
67576 return getTypeReferenceArity(t1) === getTypeReferenceArity(t2) &&
67577 ts.every(t1.target.elementFlags, function (f, i) { return (f & 12 /* ElementFlags.Variable */) === (t2.target.elementFlags[i] & 12 /* ElementFlags.Variable */); });

Callers 4

propertiesRelatedToFunction · 0.85
getRestTypeOfTupleTypeFunction · 0.85
inferFromObjectTypesFunction · 0.85

Calls 6

getTypeReferenceArityFunction · 0.85
getTypeArgumentsFunction · 0.85
getIndexedAccessTypeFunction · 0.85
getIntersectionTypeFunction · 0.85
getUnionTypeFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…