MCPcopy
hub / github.com/babel/babel / transformRepl

Function transformRepl

packages/babel-cli/src/babel/util.ts:89–103  ·  view source on GitHub ↗
(filename: string, code: string, opts: any)

Source from the content-addressed store, hash-verified

87};
88
89export 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
105export async function compile(filename: string, opts: InputOptions) {
106 opts = {

Callers

nothing calls this directly

Calls 2

resolveFunction · 0.85
transformMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…