(input: CompilerInput)
| 161 | } |
| 162 | |
| 163 | export function createPayload(input: CompilerInput): CompilerPayload { |
| 164 | const ast = parser.parse(input.code, { |
| 165 | sourceType: "module", |
| 166 | plugins: ["jsx", "typescript"], |
| 167 | }); |
| 168 | return { |
| 169 | ...input, |
| 170 | ast, |
| 171 | }; |
| 172 | } |
| 173 | |
| 174 | export function createOutput(payload: CompilerPayload): CompilerOutput { |
| 175 | const generationResult = generate(payload.ast, {}, payload.code); |