diff options
author | 2022-11-09 15:40:40 -0800 | |
---|---|---|
committer | 2022-11-09 15:40:40 -0800 | |
commit | f7f1b604443c030afe29d1059b90f72c69afe081 (patch) | |
tree | 8f2397447b2a84dab02850007264b72cc565f5d6 /src/api/demo/lib/api.ts | |
parent | da257336b0b70df8c31da647496899cf70670000 (diff) | |
download | bun-f7f1b604443c030afe29d1059b90f72c69afe081.tar.gz bun-f7f1b604443c030afe29d1059b90f72c69afe081.tar.zst bun-f7f1b604443c030afe29d1059b90f72c69afe081.zip |
Add bun-types, add typechecking, add `child_process` types (#1475)
* Add bun-types to packages
* Improve typing
* Fix types in tests
* Fix dts tests
* Run formatter
* Fix all type errors
* Add strict mode, fix type errors
* Add ffi changes
* Move workflows to root
* Add workflows
* Remove labeler
* Add child_process types
* Fix synthetic defaults issue
* Remove docs
* Move scripts
* Run prettier
* Include examples in typechecking
* captureStackTrace types
* moved captureStackTrace types to globals
* Address reviews
Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Diffstat (limited to 'src/api/demo/lib/api.ts')
-rw-r--r-- | src/api/demo/lib/api.ts | 12 |
1 files changed, 8 insertions, 4 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(); |