aboutsummaryrefslogtreecommitdiff
path: root/src/api/demo/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/demo/lib')
-rw-r--r--src/api/demo/lib/api.ts12
-rw-r--r--src/api/demo/lib/run.ts4
-rw-r--r--src/api/demo/lib/scan.ts2
3 files changed, 11 insertions, 7 deletions
diff --git a/src/api/demo/lib/api.ts b/src/api/demo/lib/api.ts
index 455c73290..d06bfd35b 100644
--- a/src/api/demo/lib/api.ts
+++ b/src/api/demo/lib/api.ts
@@ -152,7 +152,7 @@ export class Bun {
Bun.wasm_source = await globalThis.WebAssembly.instantiateStreaming(
fetch(url),
- { env: Bun[wasm_imports_sym], wasi_snapshot_preview1: Wasi }
+ { env: Bun[wasm_imports_sym], wasi_snapshot_preview1: Wasi },
);
const res = Bun.wasm_exports.init();
@@ -209,7 +209,7 @@ export class Bun {
".json": Loader.json,
}[path.extname(file_name)],
},
- bb
+ bb,
);
const data = bb.toUint8Array();
@@ -225,7 +225,11 @@ export class Bun {
return response;
}
- static scan(content: Uint8Array | string, file_name: string, loader: Loader) {
+ static scan(
+ content: Uint8Array | string,
+ file_name: string,
+ loader?: Loader,
+ ) {
if (!Bun.has_initialized) {
throw "Please run await Bun.init(wasm_url) before using this.";
}
@@ -262,7 +266,7 @@ export class Bun {
".json": Loader.json,
}[path.extname(file_name)],
},
- bb
+ bb,
);
const data = bb.toUint8Array();
diff --git a/src/api/demo/lib/run.ts b/src/api/demo/lib/run.ts
index 8337eb2c9..87d703556 100644
--- a/src/api/demo/lib/run.ts
+++ b/src/api/demo/lib/run.ts
@@ -27,7 +27,7 @@ const swcOptions = {
};
export async function transform(contents, file) {
- var result = {
+ var result: any = {
timings: {
esbuild: 0,
bun: 0,
@@ -59,7 +59,7 @@ export async function transform(contents, file) {
}
result.timings.swc = performance.now();
- result.swc = transformSyncSWC(contents, swcOptions);
+ result.swc = transformSyncSWC(contents, swcOptions as any);
result.timings.swc = performance.now() - result.timings.swc;
console.log("esbuild:", result.timings.esbuild, "ms");
diff --git a/src/api/demo/lib/scan.ts b/src/api/demo/lib/scan.ts
index 4d16d5b8c..c2fd7bb12 100644
--- a/src/api/demo/lib/scan.ts
+++ b/src/api/demo/lib/scan.ts
@@ -23,7 +23,7 @@ const swcOptions = {
};
export async function transform(contents, file) {
- var result = {
+ var result: any = {
timings: {
lexer: 0,
bun: 0,