(text, options)
| 38 | } |
| 39 | |
| 40 | function parse(text, options) { |
| 41 | const sourceType = getSourceType(options?.filepath); |
| 42 | const combinations = ( |
| 43 | sourceType ? [sourceType] : SOURCE_TYPE_COMBINATIONS |
| 44 | ).map( |
| 45 | (sourceType) => () => espreeParse(text, { ...parseOptions, sourceType }), |
| 46 | ); |
| 47 | |
| 48 | let ast; |
| 49 | try { |
| 50 | ast = tryCombinationsSync(combinations); |
| 51 | } catch (/** @type {any} */ { errors: [error] }) { |
| 52 | throw createParseError(error); |
| 53 | } |
| 54 | |
| 55 | return postprocess(ast, { text, astType: "espree" }); |
| 56 | } |
| 57 | |
| 58 | export const espree = /* @__PURE__ */ createParser(parse); |
nothing calls this directly
no test coverage detected