MCPcopy Create free account
hub / github.com/prettier/prettier / parseWithOptions

Function parseWithOptions

src/language-js/parse/babel.js:101–110  ·  view source on GitHub ↗
(parse, text, options)

Source from the content-addressed store, hash-verified

99}
100
101function parseWithOptions(parse, text, options) {
102 const ast = parse(text, options);
103 const error = ast.errors.find(
104 (error) => !allowedReasonCodes.has(error.reasonCode),
105 );
106 if (error) {
107 throw error;
108 }
109 return ast;
110}
111
112/**
113@param {{isExpression: boolean, optionsCombinations: ParserOptions[]}} param0

Callers 1

createParseFunction · 0.70

Calls 1

parseFunction · 0.90

Tested by

no test coverage detected