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

Function parseUnionOrIntersectionType

test/fixtures/snapshot/typescript.js:34166–34180  ·  view source on GitHub ↗
(operator, parseConstituentType, createTypeNode)

Source from the content-addressed store, hash-verified

34164 return undefined;
34165 }
34166 function parseUnionOrIntersectionType(operator, parseConstituentType, createTypeNode) {
34167 var pos = getNodePos();
34168 var isUnionType = operator === 51 /* SyntaxKind.BarToken */;
34169 var hasLeadingOperator = parseOptional(operator);
34170 var type = hasLeadingOperator && parseFunctionOrConstructorTypeToError(isUnionType)
34171 || parseConstituentType();
34172 if (token() === operator || hasLeadingOperator) {
34173 var types = [type];
34174 while (parseOptional(operator)) {
34175 types.push(parseFunctionOrConstructorTypeToError(isUnionType) || parseConstituentType());
34176 }
34177 type = finishNode(createTypeNode(createNodeArray(types, pos)), pos);
34178 }
34179 return type;
34180 }
34181 function parseIntersectionTypeOrHigher() {
34182 return parseUnionOrIntersectionType(50 /* SyntaxKind.AmpersandToken */, parseTypeOperatorOrHigher, factory.createIntersectionTypeNode);
34183 }

Callers 2

parseUnionTypeOrHigherFunction · 0.85

Calls 8

getNodePosFunction · 0.85
parseOptionalFunction · 0.85
finishNodeFunction · 0.85
createTypeNodeFunction · 0.85
createNodeArrayFunction · 0.85
tokenFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…