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

Function getUnionOrEvolvingArrayType

test/fixtures/snapshot/typescript.js:70737–70746  ·  view source on GitHub ↗
(types, subtypeReduction)

Source from the content-addressed store, hash-verified

70735 // is an evolving array type, we construct a combined evolving array type. Otherwise we
70736 // finalize all evolving array types.
70737 function getUnionOrEvolvingArrayType(types, subtypeReduction) {
70738 if (isEvolvingArrayTypeList(types)) {
70739 return getEvolvingArrayType(getUnionType(ts.map(types, getElementTypeOfEvolvingArrayType)));
70740 }
70741 var result = getUnionType(ts.sameMap(types, finalizeEvolvingArrayType), subtypeReduction);
70742 if (result !== declaredType && result.flags & declaredType.flags & 1048576 /* TypeFlags.Union */ && ts.arraysEqual(result.types, declaredType.types)) {
70743 return declaredType;
70744 }
70745 return result;
70746 }
70747 function getCandidateDiscriminantPropertyAccess(expr) {
70748 if (ts.isBindingPattern(reference) || ts.isFunctionExpressionOrArrowFunction(reference) || ts.isObjectLiteralMethod(reference)) {
70749 // When the reference is a binding pattern or function or arrow expression, we are narrowing a pesudo-reference in

Callers 2

getTypeAtFlowBranchLabelFunction · 0.85
getTypeAtFlowLoopLabelFunction · 0.85

Calls 4

isEvolvingArrayTypeListFunction · 0.85
getEvolvingArrayTypeFunction · 0.85
getUnionTypeFunction · 0.85
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…