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

Function parseType

test/fixtures/snapshot/typescript.js:34271–34290  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34269 return finishNode(factory.createTypePredicateNode(assertsModifier, parameterName, type), pos);
34270 }
34271 function parseType() {
34272 if (contextFlags & 40960 /* NodeFlags.TypeExcludesFlags */) {
34273 return doOutsideOfContext(40960 /* NodeFlags.TypeExcludesFlags */, parseType);
34274 }
34275 if (isStartOfFunctionTypeOrConstructorType()) {
34276 return parseFunctionOrConstructorType();
34277 }
34278 var pos = getNodePos();
34279 var type = parseUnionTypeOrHigher();
34280 if (!inDisallowConditionalTypesContext() && !scanner.hasPrecedingLineBreak() && parseOptional(94 /* SyntaxKind.ExtendsKeyword */)) {
34281 // The type following 'extends' is not permitted to be another conditional type
34282 var extendsType = disallowConditionalTypesAnd(parseType);
34283 parseExpected(57 /* SyntaxKind.QuestionToken */);
34284 var trueType = allowConditionalTypesAnd(parseType);
34285 parseExpected(58 /* SyntaxKind.ColonToken */);
34286 var falseType = allowConditionalTypesAnd(parseType);
34287 return finishNode(factory.createConditionalTypeNode(type, extendsType, trueType, falseType), pos);
34288 }
34289 return type;
34290 }
34291 function parseTypeAnnotation() {
34292 return parseOptional(58 /* SyntaxKind.ColonToken */) ? parseType() : undefined;
34293 }

Callers 15

parseTemplateTypeSpanFunction · 0.85
parseThisTypePredicateFunction · 0.85
parseTypeParameterFunction · 0.85
parseMappedTypeParameterFunction · 0.85
parseMappedTypeFunction · 0.85
parseTupleElementTypeFunction · 0.85
parseParenthesizedTypeFunction · 0.85
parseImportTypeFunction · 0.85
parsePostfixTypeOrHigherFunction · 0.85
parseTypeOrTypePredicateFunction · 0.85

Calls 11

doOutsideOfContextFunction · 0.85
getNodePosFunction · 0.85
parseUnionTypeOrHigherFunction · 0.85
parseOptionalFunction · 0.85
parseExpectedFunction · 0.85
allowConditionalTypesAndFunction · 0.85
finishNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…