You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
654 B
TypeScript
22 lines
654 B
TypeScript
import { decompress } from "https://deno.land/x/lz4@v0.1.2/mod.ts";
|
|
import type {
|
|
Config,
|
|
ParseOptions,
|
|
Program,
|
|
} from "https://esm.sh/@swc/core@1.2.212/types.d.ts";
|
|
import { instantiate } from "./lib/deno_swc.generated.js";
|
|
|
|
const { parseSync, printSync, transformSync } = await instantiate(decompress);
|
|
|
|
export function parse(source: string, opts: ParseOptions): Program {
|
|
return parseSync(source, opts);
|
|
}
|
|
|
|
export function print(program: Program, opts?: Config): { code: string } {
|
|
return printSync(program, opts || {});
|
|
}
|
|
|
|
export function transform(source: string, opts: Config): { code: string } {
|
|
return transformSync(source, opts);
|
|
}
|