(text)
| 48 | return { |
| 49 | astFormat: "estree", |
| 50 | parse(text) { |
| 51 | /** @type {Exclude<ReturnType<ParseMethod>, TupleTypeAnnotation>} */ |
| 52 | let node; |
| 53 | |
| 54 | try { |
| 55 | // @ts-expect-error -- safe |
| 56 | node = parseMethod(text); |
| 57 | } catch (error) { |
| 58 | throw createParseError(error); |
| 59 | } |
| 60 | |
| 61 | // @ts-expect-error -- safe |
| 62 | const { comments } = node; |
| 63 | // @ts-expect-error -- safe |
| 64 | delete node.comments; |
| 65 | |
| 66 | if (parseMethod === parseAction && node.type !== "NGChainedExpression") { |
| 67 | node = { ...node, type: "NGChainedExpression", expressions: [node] }; |
| 68 | } |
| 69 | |
| 70 | return wrapExpression({ |
| 71 | type: "NGRoot", |
| 72 | expression: node, |
| 73 | comments, |
| 74 | text, |
| 75 | }); |
| 76 | }, |
| 77 | locStart, |
| 78 | locEnd, |
| 79 | }; |
nothing calls this directly
no test coverage detected