(filename: string, code: string, opts: any)
| 87 | }; |
| 88 | |
| 89 | export function transformRepl(filename: string, code: string, opts: any) { |
| 90 | opts = { |
| 91 | ...opts, |
| 92 | sourceMaps: opts.sourceMaps === "inline" ? true : opts.sourceMaps, |
| 93 | caller: REPL_CALLER, |
| 94 | filename, |
| 95 | }; |
| 96 | |
| 97 | return new Promise<FileResult>((resolve, reject) => { |
| 98 | babel.transform(code, opts, (err, result) => { |
| 99 | if (err) reject(err); |
| 100 | else resolve(result!); |
| 101 | }); |
| 102 | }); |
| 103 | } |
| 104 | |
| 105 | export async function compile(filename: string, opts: InputOptions) { |
| 106 | opts = { |