aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Colin McDonnell <colinmcd94@gmail.com> 2022-11-09 15:40:40 -0800
committerGravatar GitHub <noreply@github.com> 2022-11-09 15:40:40 -0800
commitf7f1b604443c030afe29d1059b90f72c69afe081 (patch)
tree8f2397447b2a84dab02850007264b72cc565f5d6 /src
parentda257336b0b70df8c31da647496899cf70670000 (diff)
downloadbun-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')
-rw-r--r--src/.prettierignore1
-rwxr-xr-xsrc/api/bun.lockbbin5938 -> 7147 bytes
-rwxr-xr-xsrc/api/demo/bun.lockbbin63276 -> 76858 bytes
-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
-rw-r--r--src/api/demo/next-env.d.ts5
-rw-r--r--src/api/demo/package-lock.json273
-rw-r--r--src/api/demo/package.json3
-rw-r--r--src/api/demo/pages/_app.js6
-rw-r--r--src/api/demo/pages/api/hello.js4
-rw-r--r--src/api/demo/pages/index.tsx15
-rw-r--r--src/api/demo/pages/scan.tsx16
-rw-r--r--src/api/demo/pages/two.tsx1
-rw-r--r--src/api/demo/schema.d.ts144
-rw-r--r--src/api/demo/schema.js54
-rw-r--r--src/api/demo/tsconfig.json13
-rw-r--r--src/api/package.json2
-rw-r--r--src/api/schema.d.ts144
-rw-r--r--src/api/schema.js56
-rw-r--r--src/bun.js/assert.exports.js150
-rw-r--r--src/bun.js/bindings/sqlite/sqlite.exports.js26
-rw-r--r--src/bun.js/child_process.exports.js34
-rw-r--r--src/bun.js/depd.exports.js2
-rw-r--r--src/bun.js/ffi.exports.js18
-rw-r--r--src/bun.js/fs.exports.js12
-rw-r--r--src/bun.js/http.exports.js10
-rw-r--r--src/bun.js/net.exports.js2
-rw-r--r--src/bun.js/perf_hooks.exports.js2
-rw-r--r--src/bun.js/scripts/class-definitions.ts9
-rw-r--r--src/bun.js/scripts/generate-classes.ts243
-rw-r--r--src/bun.js/scripts/generate-jssink.js22
-rw-r--r--src/bun.js/streams.exports.js188
-rw-r--r--src/bun.js/url.exports.js454
-rw-r--r--src/bun.js/ws.exports.js2
-rw-r--r--src/cli/tsconfig-for-init.json9
-rw-r--r--src/fallback.ts3
-rw-r--r--src/node-fallbacks/@vercel_fetch.js2
-rw-r--r--src/node-fallbacks/assert.js2
-rw-r--r--src/node-fallbacks/events.js22
-rw-r--r--src/node-fallbacks/net.js28
-rw-r--r--src/react-refresh.js343
-rw-r--r--src/runtime.footer.node.js4
-rw-r--r--src/runtime.js24
-rw-r--r--src/runtime/errors.ts1
-rw-r--r--src/runtime/hmr.ts97
-rw-r--r--src/runtime/index-with-refresh.ts3
-rw-r--r--src/runtime/index-without-hmr.ts1
-rw-r--r--src/runtime/index.ts1
-rw-r--r--src/runtime/regenerator.ts15
-rw-r--r--src/test/fixtures/browsermap-false.ts1
-rw-r--r--src/test/fixtures/cannot-assign-to-import-bug.js110
-rw-r--r--src/test/fixtures/class-with-property.ts1
-rw-r--r--src/test/fixtures/default_export_hmr_identifier_ref.tsx1
-rw-r--r--src/test/fixtures/exports-bug.js122
-rw-r--r--src/test/fixtures/json-parser-in-typescript.js3
-rw-r--r--src/test/fixtures/json-parser-in-typescript.ts28
-rw-r--r--src/test/fixtures/main-field.ts1
-rw-r--r--src/test/fixtures/namespaced-validators.ts2
-rw-r--r--src/test/fixtures/out.esbuild.js3
-rw-r--r--src/test/fixtures/simple-150x.jsx4
-rw-r--r--src/test/fixtures/simple.jsx4
-rw-r--r--src/test/fixtures/tsconfig.json8
-rw-r--r--src/test/fixtures/type-only-import.ts3
-rw-r--r--src/test/fixtures/typescript-is-turing-complete.ts7
65 files changed, 1949 insertions, 833 deletions
diff --git a/src/.prettierignore b/src/.prettierignore
deleted file mode 100644
index b50b4c262..000000000
--- a/src/.prettierignore
+++ /dev/null
@@ -1 +0,0 @@
-fallback.html \ No newline at end of file
diff --git a/src/api/bun.lockb b/src/api/bun.lockb
index 90a1dd4c9..7d9cafc34 100755
--- a/src/api/bun.lockb
+++ b/src/api/bun.lockb
Binary files differ
diff --git a/src/api/demo/bun.lockb b/src/api/demo/bun.lockb
index 7d3f87eb3..1c5c6e269 100755
--- a/src/api/demo/bun.lockb
+++ b/src/api/demo/bun.lockb
Binary files differ
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,
diff --git a/src/api/demo/next-env.d.ts b/src/api/demo/next-env.d.ts
index 7b7aa2c77..4f11a03dc 100644
--- a/src/api/demo/next-env.d.ts
+++ b/src/api/demo/next-env.d.ts
@@ -1,2 +1,5 @@
/// <reference types="next" />
-/// <reference types="next/types/global" />
+/// <reference types="next/image-types/global" />
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/basic-features/typescript for more information.
diff --git a/src/api/demo/package-lock.json b/src/api/demo/package-lock.json
index 9b83211cb..bf3924fb5 100644
--- a/src/api/demo/package-lock.json
+++ b/src/api/demo/package-lock.json
@@ -4378,6 +4378,201 @@
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
+ },
+ "node_modules/@next/swc-android-arm-eabi": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.2.tgz",
+ "integrity": "sha512-r2rrz+DZ8YYGqzVrbRrpP6GKzwozpOrnFbErc4k36vUTSFMag9yQahZfaBe06JYdqu/e5yhm/saIDEaSVPRP4g==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-android-arm64": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.3.2.tgz",
+ "integrity": "sha512-B+TINJhCf+CrY1+b3/JWQlkecv53rAGa/gA7gi5B1cnBa/2Uvoe+Ue0JeCefTjfiyl1ScsyNx+NcESY8Ye2Ngg==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "android"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-darwin-arm64": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.2.tgz",
+ "integrity": "sha512-PTUfe1ZrwjsiuTmr3bOM9lsoy5DCmfYsLOUF9ZVhtbi5MNJVmUTy4VZ06GfrvnCO5hGCr48z3vpFE9QZ0qLcPw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-darwin-x64": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.2.tgz",
+ "integrity": "sha512-1HkjmS9awwlaeEY8Y01nRSNkSv3y+qnC/mjMPe/W66hEh3QKa/LQHqHeS7NOdEs19B2mhZ7w+EgMRXdLQ0Su8w==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-freebsd-x64": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.2.tgz",
+ "integrity": "sha512-h5Mx0BKDCJ5Vu/U8e07esF6PjPv1EJgmRbYWTUZMAflu13MQpCJkKEJir7+BeRfTXRfgFf+llc7uocrpd7mcrg==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "freebsd"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-arm-gnueabihf": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.2.tgz",
+ "integrity": "sha512-EuRZAamoxfe/WoWRaC0zsCAoE4gs/mEhilcloNM4J5Mnb3PLY8PZV394W7t5tjBjItMCF7l2Ebwjwtm46tq2RA==",
+ "cpu": [
+ "arm"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-arm64-gnu": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.2.tgz",
+ "integrity": "sha512-T9GCFyOIb4S3acA9LqflUYD+QZ94iZketHCqKdoO0Nx0OCHIgGJV5rotDe8TDXwh/goYpIfyHU4j1qqw4w4VnA==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-arm64-musl": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.2.tgz",
+ "integrity": "sha512-hxNVZS6L3c2z3l9EH2GP0MGQ9exu6O8cohYNZyqC9WUl6C03sEn8xzDH1y+NgD3fVurvYkGU5F0PDddJJLfDIw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-x64-gnu": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.3.2.tgz",
+ "integrity": "sha512-fCPkLuwDwY8/QeXxciJJjDHG09liZym/Bhb4A+RLFQ877wUkwFsNWDUTSdUx0YXlYK/1gf67BKauqKkOKp6CYw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-linux-x64-musl": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.3.2.tgz",
+ "integrity": "sha512-o+GifBIQ2K+/MEFxHsxUZoU3bsuVFLXZYWd3idimFHiVdDCVYiKsY6mYMmKDlucX+9xRyOCkKL9Tjf+3tuXJpw==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "linux"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-win32-arm64-msvc": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.2.tgz",
+ "integrity": "sha512-crii66irzGGMSUR0L8r9+A06eTv7FTXqw4rgzJ33M79EwQJOdpY7RVKXLQMurUhniEeQEEOfamiEdPIi/qxisw==",
+ "cpu": [
+ "arm64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-win32-ia32-msvc": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.2.tgz",
+ "integrity": "sha512-5hRUSvn3MdQ4nVRu1rmKxq5YJzpTtZfaC/NyGw6wa4NSF1noUn/pdQGUr+I5Qz3CZkd1gZzzC0eaXQHlrk0E2g==",
+ "cpu": [
+ "ia32"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
+ },
+ "node_modules/@next/swc-win32-x64-msvc": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.2.tgz",
+ "integrity": "sha512-tpQJYUH+TzPMIsdVl9fH8uDg47iwiNjKY+8e9da3dXqlkztKzjSw0OwSADoqh3KrifplXeKSta+BBGLdBqg3sg==",
+ "cpu": [
+ "x64"
+ ],
+ "optional": true,
+ "os": [
+ "win32"
+ ],
+ "engines": {
+ "node": ">= 10"
+ }
}
},
"dependencies": {
@@ -7575,6 +7770,84 @@
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
"integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="
+ },
+ "@next/swc-android-arm-eabi": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.2.tgz",
+ "integrity": "sha512-r2rrz+DZ8YYGqzVrbRrpP6GKzwozpOrnFbErc4k36vUTSFMag9yQahZfaBe06JYdqu/e5yhm/saIDEaSVPRP4g==",
+ "optional": true
+ },
+ "@next/swc-android-arm64": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.3.2.tgz",
+ "integrity": "sha512-B+TINJhCf+CrY1+b3/JWQlkecv53rAGa/gA7gi5B1cnBa/2Uvoe+Ue0JeCefTjfiyl1ScsyNx+NcESY8Ye2Ngg==",
+ "optional": true
+ },
+ "@next/swc-darwin-arm64": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.3.2.tgz",
+ "integrity": "sha512-PTUfe1ZrwjsiuTmr3bOM9lsoy5DCmfYsLOUF9ZVhtbi5MNJVmUTy4VZ06GfrvnCO5hGCr48z3vpFE9QZ0qLcPw==",
+ "optional": true
+ },
+ "@next/swc-darwin-x64": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-12.3.2.tgz",
+ "integrity": "sha512-1HkjmS9awwlaeEY8Y01nRSNkSv3y+qnC/mjMPe/W66hEh3QKa/LQHqHeS7NOdEs19B2mhZ7w+EgMRXdLQ0Su8w==",
+ "optional": true
+ },
+ "@next/swc-freebsd-x64": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.2.tgz",
+ "integrity": "sha512-h5Mx0BKDCJ5Vu/U8e07esF6PjPv1EJgmRbYWTUZMAflu13MQpCJkKEJir7+BeRfTXRfgFf+llc7uocrpd7mcrg==",
+ "optional": true
+ },
+ "@next/swc-linux-arm-gnueabihf": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.2.tgz",
+ "integrity": "sha512-EuRZAamoxfe/WoWRaC0zsCAoE4gs/mEhilcloNM4J5Mnb3PLY8PZV394W7t5tjBjItMCF7l2Ebwjwtm46tq2RA==",
+ "optional": true
+ },
+ "@next/swc-linux-arm64-gnu": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.3.2.tgz",
+ "integrity": "sha512-T9GCFyOIb4S3acA9LqflUYD+QZ94iZketHCqKdoO0Nx0OCHIgGJV5rotDe8TDXwh/goYpIfyHU4j1qqw4w4VnA==",
+ "optional": true
+ },
+ "@next/swc-linux-arm64-musl": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.3.2.tgz",
+ "integrity": "sha512-hxNVZS6L3c2z3l9EH2GP0MGQ9exu6O8cohYNZyqC9WUl6C03sEn8xzDH1y+NgD3fVurvYkGU5F0PDddJJLfDIw==",
+ "optional": true
+ },
+ "@next/swc-linux-x64-gnu": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.3.2.tgz",
+ "integrity": "sha512-fCPkLuwDwY8/QeXxciJJjDHG09liZym/Bhb4A+RLFQ877wUkwFsNWDUTSdUx0YXlYK/1gf67BKauqKkOKp6CYw==",
+ "optional": true
+ },
+ "@next/swc-linux-x64-musl": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.3.2.tgz",
+ "integrity": "sha512-o+GifBIQ2K+/MEFxHsxUZoU3bsuVFLXZYWd3idimFHiVdDCVYiKsY6mYMmKDlucX+9xRyOCkKL9Tjf+3tuXJpw==",
+ "optional": true
+ },
+ "@next/swc-win32-arm64-msvc": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.3.2.tgz",
+ "integrity": "sha512-crii66irzGGMSUR0L8r9+A06eTv7FTXqw4rgzJ33M79EwQJOdpY7RVKXLQMurUhniEeQEEOfamiEdPIi/qxisw==",
+ "optional": true
+ },
+ "@next/swc-win32-ia32-msvc": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.3.2.tgz",
+ "integrity": "sha512-5hRUSvn3MdQ4nVRu1rmKxq5YJzpTtZfaC/NyGw6wa4NSF1noUn/pdQGUr+I5Qz3CZkd1gZzzC0eaXQHlrk0E2g==",
+ "optional": true
+ },
+ "@next/swc-win32-x64-msvc": {
+ "version": "12.3.2",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.3.2.tgz",
+ "integrity": "sha512-tpQJYUH+TzPMIsdVl9fH8uDg47iwiNjKY+8e9da3dXqlkztKzjSw0OwSADoqh3KrifplXeKSta+BBGLdBqg3sg==",
+ "optional": true
}
}
}
diff --git a/src/api/demo/package.json b/src/api/demo/package.json
index ac452254a..59e70aed1 100644
--- a/src/api/demo/package.json
+++ b/src/api/demo/package.json
@@ -14,13 +14,14 @@
"esbuild": "^0.14.23",
"esbuild-wasm": "^0.14.23",
"next": "12",
- "peechy": "latest",
+ "peechy": "0.4.32",
"react": "17.0.2",
"react-dom": "17.0.2",
"sucrase": "^3.18.1"
},
"devDependencies": {
"@types/react": "^17.0.8",
+ "bun-types": "^0.2.2",
"typescript": "^4.3.2",
"webpack": "^5.38.1",
"webpack-cli": "^4.7.0"
diff --git a/src/api/demo/pages/_app.js b/src/api/demo/pages/_app.js
index 1e1cec924..2fc3e0700 100644
--- a/src/api/demo/pages/_app.js
+++ b/src/api/demo/pages/_app.js
@@ -1,7 +1,7 @@
-import '../styles/globals.css'
+import "../styles/globals.css";
function MyApp({ Component, pageProps }) {
- return <Component {...pageProps} />
+ return <Component {...pageProps} />;
}
-export default MyApp
+export default MyApp;
diff --git a/src/api/demo/pages/api/hello.js b/src/api/demo/pages/api/hello.js
index 9987aff4c..e963280fa 100644
--- a/src/api/demo/pages/api/hello.js
+++ b/src/api/demo/pages/api/hello.js
@@ -1,5 +1,5 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default (req, res) => {
- res.status(200).json({ name: 'John Doe' })
-}
+ res.status(200).json({ name: "John Doe" });
+};
diff --git a/src/api/demo/pages/index.tsx b/src/api/demo/pages/index.tsx
index 7274b3d39..24577acb3 100644
--- a/src/api/demo/pages/index.tsx
+++ b/src/api/demo/pages/index.tsx
@@ -1,19 +1,22 @@
import Head from "next/head";
import Image from "next/image";
import styles from "../styles/Home.module.css";
+import { readFile } from "fs/promises";
import React from "react";
if (typeof window !== "undefined") {
globalThis.Run = await import("../lib/run");
- await import("../lib/api.ts");
+ await import("../lib/api");
}
export async function getStaticProps(ctx) {
return {
props: {
- code: Bun.readFile(
- "/Users/jarred/Build/es-module-lexer/test/samples/magic-string.js"
+ // not tested
+ code: readFile(
+ "/Users/jarred/Build/es-module-lexer/test/samples/magic-string.js",
+ { encoding: "utf-8" },
),
},
};
@@ -21,7 +24,7 @@ export async function getStaticProps(ctx) {
var textDecoder = new TextDecoder();
export default function Home({ code }) {
- const fileNameRef = React.useRef();
+ const fileNameRef = React.useRef<HTMLInputElement>(null);
const [esbuildResult, setEsbuildResult] = React.useState("");
const [bunResult, setBunResult] = React.useState("");
const [swcResult, setSWCResult] = React.useState("");
@@ -33,14 +36,14 @@ export default function Home({ code }) {
(event) => {
globalThis.Run.transform(
event.target.value,
- fileNameRef.current.value
+ fileNameRef?.current?.value,
).then((result) => {
setEsbuildResult(result.esbuild.code);
setBunResult(textDecoder.decode(result.bun.files[0].data));
setSWCResult(result.swc.code);
}, console.error);
},
- [fileNameRef, setEsbuildResult, setBunResult, setSWCResult]
+ [fileNameRef, setEsbuildResult, setBunResult, setSWCResult],
);
return (
<div className={styles.container}>
diff --git a/src/api/demo/pages/scan.tsx b/src/api/demo/pages/scan.tsx
index 819a597b9..87cebd64d 100644
--- a/src/api/demo/pages/scan.tsx
+++ b/src/api/demo/pages/scan.tsx
@@ -1,19 +1,21 @@
import Head from "next/head";
-import Image from "next/image";
+import { readFile } from "fs/promises";
import styles from "../styles/Home.module.css";
import React from "react";
if (typeof window !== "undefined") {
globalThis.Scan = await import("../lib/scan");
- await import("../lib/api.ts");
+ await import("../lib/api");
}
export async function getStaticProps(ctx) {
return {
props: {
- code: Bun.readFile(
- "/Users/jarred/Build/es-module-lexer/test/samples/magic-string.js"
+ // not tested
+ code: readFile(
+ "/Users/jarred/Build/es-module-lexer/test/samples/magic-string.js",
+ { encoding: "utf-8" },
),
defaultFile: "magic-string.js",
},
@@ -22,7 +24,7 @@ export async function getStaticProps(ctx) {
var textDecoder = new TextDecoder();
export default function Home({ code, defaultFile }) {
- const fileNameRef = React.useRef();
+ const fileNameRef = React.useRef<HTMLInputElement>(null);
const [lexer, setLexer] = React.useState("");
const [bunResult, setBunResult] = React.useState("");
const [file, setFile] = React.useState(defaultFile);
@@ -34,13 +36,13 @@ export default function Home({ code, defaultFile }) {
(event) => {
globalThis.Scan.transform(
event.target.value,
- fileNameRef.current.value
+ fileNameRef?.current?.value,
).then((result) => {
setLexer(JSON.stringify(result.lexer, null, 2));
setBunResult(JSON.stringify(result.bun, null, 2));
}, console.error);
},
- [fileNameRef, setBunResult, setLexer]
+ [fileNameRef, setBunResult, setLexer],
);
return (
<div className={styles.container}>
diff --git a/src/api/demo/pages/two.tsx b/src/api/demo/pages/two.tsx
index e69de29bb..cb0ff5c3b 100644
--- a/src/api/demo/pages/two.tsx
+++ b/src/api/demo/pages/two.tsx
@@ -0,0 +1 @@
+export {};
diff --git a/src/api/demo/schema.d.ts b/src/api/demo/schema.d.ts
index 0a7ed3b9b..ae4551128 100644
--- a/src/api/demo/schema.d.ts
+++ b/src/api/demo/schema.d.ts
@@ -685,29 +685,29 @@ export interface BunInstall {
export declare function encodeStackFrame(
message: StackFrame,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeStackFrame(buffer: ByteBuffer): StackFrame;
export declare function encodeStackFramePosition(
message: StackFramePosition,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeStackFramePosition(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): StackFramePosition;
export declare function encodeSourceLine(
message: SourceLine,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeSourceLine(buffer: ByteBuffer): SourceLine;
export declare function encodeStackTrace(
message: StackTrace,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeStackTrace(buffer: ByteBuffer): StackTrace;
export declare function encodeJSException(
message: JSException,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeJSException(buffer: ByteBuffer): JSException;
export declare function encodeProblems(message: Problems, bb: ByteBuffer): void;
@@ -716,175 +716,175 @@ export declare function encodeRouter(message: Router, bb: ByteBuffer): void;
export declare function decodeRouter(buffer: ByteBuffer): Router;
export declare function encodeFallbackMessageContainer(
message: FallbackMessageContainer,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFallbackMessageContainer(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): FallbackMessageContainer;
export declare function encodeJSX(message: JSX, bb: ByteBuffer): void;
export declare function decodeJSX(buffer: ByteBuffer): JSX;
export declare function encodeStringPointer(
message: StringPointer,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeStringPointer(buffer: ByteBuffer): StringPointer;
export declare function encodeJavascriptBundledModule(
message: JavascriptBundledModule,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeJavascriptBundledModule(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): JavascriptBundledModule;
export declare function encodeJavascriptBundledPackage(
message: JavascriptBundledPackage,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeJavascriptBundledPackage(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): JavascriptBundledPackage;
export declare function encodeJavascriptBundle(
message: JavascriptBundle,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeJavascriptBundle(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): JavascriptBundle;
export declare function encodeJavascriptBundleContainer(
message: JavascriptBundleContainer,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeJavascriptBundleContainer(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): JavascriptBundleContainer;
export declare function encodeModuleImportRecord(
message: ModuleImportRecord,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeModuleImportRecord(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): ModuleImportRecord;
export declare function encodeModule(message: Module, bb: ByteBuffer): void;
export declare function decodeModule(buffer: ByteBuffer): Module;
export declare function encodeStringMap(
message: StringMap,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeStringMap(buffer: ByteBuffer): StringMap;
export declare function encodeLoaderMap(
message: LoaderMap,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeLoaderMap(buffer: ByteBuffer): LoaderMap;
export declare function encodeEnvConfig(
message: EnvConfig,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeEnvConfig(buffer: ByteBuffer): EnvConfig;
export declare function encodeLoadedEnvConfig(
message: LoadedEnvConfig,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeLoadedEnvConfig(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): LoadedEnvConfig;
export declare function encodeFrameworkConfig(
message: FrameworkConfig,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFrameworkConfig(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): FrameworkConfig;
export declare function encodeFrameworkEntryPoint(
message: FrameworkEntryPoint,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFrameworkEntryPoint(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): FrameworkEntryPoint;
export declare function encodeFrameworkEntryPointMap(
message: FrameworkEntryPointMap,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFrameworkEntryPointMap(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): FrameworkEntryPointMap;
export declare function encodeFrameworkEntryPointMessage(
message: FrameworkEntryPointMessage,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFrameworkEntryPointMessage(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): FrameworkEntryPointMessage;
export declare function encodeLoadedFramework(
message: LoadedFramework,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeLoadedFramework(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): LoadedFramework;
export declare function encodeLoadedRouteConfig(
message: LoadedRouteConfig,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeLoadedRouteConfig(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): LoadedRouteConfig;
export declare function encodeRouteConfig(
message: RouteConfig,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeRouteConfig(buffer: ByteBuffer): RouteConfig;
export declare function encodeTransformOptions(
message: TransformOptions,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeTransformOptions(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): TransformOptions;
export declare function encodeFileHandle(
message: FileHandle,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFileHandle(buffer: ByteBuffer): FileHandle;
export declare function encodeTransform(
message: Transform,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeTransform(buffer: ByteBuffer): Transform;
export declare function encodeScan(message: Scan, bb: ByteBuffer): void;
export declare function decodeScan(buffer: ByteBuffer): Scan;
export declare function encodeScanResult(
message: ScanResult,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeScanResult(buffer: ByteBuffer): ScanResult;
export declare function encodeScannedImport(
message: ScannedImport,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeScannedImport(buffer: ByteBuffer): ScannedImport;
export declare function encodeOutputFile(
message: OutputFile,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeOutputFile(buffer: ByteBuffer): OutputFile;
export declare function encodeTransformResponse(
message: TransformResponse,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeTransformResponse(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): TransformResponse;
export declare function encodeLocation(message: Location, bb: ByteBuffer): void;
export declare function decodeLocation(buffer: ByteBuffer): Location;
export declare function encodeMessageData(
message: MessageData,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeMessageData(buffer: ByteBuffer): MessageData;
export declare function encodeMessageMeta(
message: MessageMeta,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeMessageMeta(buffer: ByteBuffer): MessageMeta;
export declare function encodeMessage(message: Message, bb: ByteBuffer): void;
@@ -893,88 +893,88 @@ export declare function encodeLog(message: Log, bb: ByteBuffer): void;
export declare function decodeLog(buffer: ByteBuffer): Log;
export declare function encodeWebsocketMessage(
message: WebsocketMessage,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessage(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessage;
export declare function encodeWebsocketMessageWelcome(
message: WebsocketMessageWelcome,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessageWelcome(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessageWelcome;
export declare function encodeWebsocketMessageFileChangeNotification(
message: WebsocketMessageFileChangeNotification,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessageFileChangeNotification(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessageFileChangeNotification;
export declare function encodeWebsocketCommand(
message: WebsocketCommand,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketCommand(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketCommand;
export declare function encodeWebsocketCommandBuild(
message: WebsocketCommandBuild,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketCommandBuild(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketCommandBuild;
export declare function encodeWebsocketCommandManifest(
message: WebsocketCommandManifest,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketCommandManifest(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketCommandManifest;
export declare function encodeWebsocketMessageBuildSuccess(
message: WebsocketMessageBuildSuccess,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessageBuildSuccess(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessageBuildSuccess;
export declare function encodeWebsocketMessageBuildFailure(
message: WebsocketMessageBuildFailure,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessageBuildFailure(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessageBuildFailure;
export declare function encodeWebsocketCommandBuildWithFilePath(
message: WebsocketCommandBuildWithFilePath,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketCommandBuildWithFilePath(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketCommandBuildWithFilePath;
export declare function encodeWebsocketMessageResolveID(
message: WebsocketMessageResolveID,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessageResolveID(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessageResolveID;
export declare function encodeNPMRegistry(
message: NPMRegistry,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeNPMRegistry(buffer: ByteBuffer): NPMRegistry;
export declare function encodeNPMRegistryMap(
message: NPMRegistryMap,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeNPMRegistryMap(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): NPMRegistryMap;
export declare function encodeBunInstall(
message: BunInstall,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeBunInstall(buffer: ByteBuffer): BunInstall;
diff --git a/src/api/demo/schema.js b/src/api/demo/schema.js
index b89ed4a08..2c31d9512 100644
--- a/src/api/demo/schema.js
+++ b/src/api/demo/schema.js
@@ -120,7 +120,9 @@ function encodeStackFrame(message, bb) {
var encoded = StackFrameScope[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "StackFrameScope"'
+ "Invalid value " +
+ JSON.stringify(value) +
+ ' for enum "StackFrameScope"',
);
bb.writeByte(encoded);
} else {
@@ -500,7 +502,7 @@ function encodeFallbackMessageContainer(message, bb) {
var encoded = FallbackStep[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "FallbackStep"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "FallbackStep"',
);
bb.writeByte(encoded);
}
@@ -612,7 +614,7 @@ function encodeJSX(message, bb) {
var encoded = JSXRuntime[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "JSXRuntime"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "JSXRuntime"',
);
bb.writeByte(encoded);
} else {
@@ -833,7 +835,7 @@ function encodeJavascriptBundle(message, bb) {
bb.writeByteArray(value);
} else {
throw new Error(
- 'Missing required field "app_package_json_dependencies_hash"'
+ 'Missing required field "app_package_json_dependencies_hash"',
);
}
@@ -960,7 +962,7 @@ function encodeModuleImportRecord(message, bb) {
throw new Error(
"Invalid value " +
JSON.stringify(value) +
- ' for enum "ModuleImportType"'
+ ' for enum "ModuleImportType"',
);
bb.writeByte(encoded);
} else {
@@ -1090,7 +1092,7 @@ function encodeLoaderMap(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
}
@@ -1167,7 +1169,7 @@ function encodeLoadedEnvConfig(message, bb) {
var encoded = DotEnvBehavior[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "DotEnvBehavior"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "DotEnvBehavior"',
);
bb.writeVarUint(encoded);
} else {
@@ -1272,7 +1274,9 @@ function encodeFrameworkConfig(message, bb) {
var encoded = CSSInJSBehavior[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "CSSInJSBehavior"'
+ "Invalid value " +
+ JSON.stringify(value) +
+ ' for enum "CSSInJSBehavior"',
);
bb.writeByte(encoded);
}
@@ -1308,7 +1312,7 @@ function encodeFrameworkEntryPoint(message, bb) {
throw new Error(
"Invalid value " +
JSON.stringify(value) +
- ' for enum "FrameworkEntryPointType"'
+ ' for enum "FrameworkEntryPointType"',
);
bb.writeByte(encoded);
} else {
@@ -1460,7 +1464,9 @@ function encodeLoadedFramework(message, bb) {
var encoded = CSSInJSBehavior[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "CSSInJSBehavior"'
+ "Invalid value " +
+ JSON.stringify(value) +
+ ' for enum "CSSInJSBehavior"',
);
bb.writeByte(encoded);
} else {
@@ -1743,7 +1749,7 @@ function encodeTransformOptions(message, bb) {
var encoded = ResolveMode[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "ResolveMode"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "ResolveMode"',
);
bb.writeByte(encoded);
}
@@ -1844,7 +1850,7 @@ function encodeTransformOptions(message, bb) {
var encoded = Platform[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Platform"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Platform"',
);
bb.writeByte(encoded);
}
@@ -1921,7 +1927,7 @@ function encodeTransformOptions(message, bb) {
var encoded = MessageLevel[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "MessageLevel"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "MessageLevel"',
);
bb.writeVarUint(encoded);
}
@@ -2019,7 +2025,7 @@ function encodeTransform(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
}
@@ -2077,7 +2083,7 @@ function encodeScan(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
}
@@ -2145,7 +2151,7 @@ function encodeScannedImport(message, bb) {
var encoded = ImportKind[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "ImportKind"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "ImportKind"',
);
bb.writeByte(encoded);
} else {
@@ -2246,7 +2252,7 @@ function encodeTransformResponse(message, bb) {
throw new Error(
"Invalid value " +
JSON.stringify(value) +
- ' for enum "TransformResponseStatus"'
+ ' for enum "TransformResponseStatus"',
);
bb.writeVarUint(encoded);
} else {
@@ -2460,7 +2466,7 @@ function encodeMessage(message, bb) {
var encoded = MessageLevel[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "MessageLevel"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "MessageLevel"',
);
bb.writeVarUint(encoded);
} else {
@@ -2626,7 +2632,7 @@ function encodeWebsocketMessage(message, bb) {
throw new Error(
"Invalid value " +
JSON.stringify(value) +
- ' for enum "WebsocketMessageKind"'
+ ' for enum "WebsocketMessageKind"',
);
bb.writeByte(encoded);
} else {
@@ -2656,7 +2662,7 @@ function encodeWebsocketMessageWelcome(message, bb) {
var encoded = Reloader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Reloader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Reloader"',
);
bb.writeByte(encoded);
} else {
@@ -2692,7 +2698,7 @@ function encodeWebsocketMessageFileChangeNotification(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
} else {
@@ -2716,7 +2722,7 @@ function encodeWebsocketCommand(message, bb) {
throw new Error(
"Invalid value " +
JSON.stringify(value) +
- ' for enum "WebsocketCommandKind"'
+ ' for enum "WebsocketCommandKind"',
);
bb.writeByte(encoded);
} else {
@@ -2794,7 +2800,7 @@ function encodeWebsocketMessageBuildSuccess(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
} else {
@@ -2847,7 +2853,7 @@ function encodeWebsocketMessageBuildFailure(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
} else {
diff --git a/src/api/demo/tsconfig.json b/src/api/demo/tsconfig.json
index 35d51eac9..4fa2cd009 100644
--- a/src/api/demo/tsconfig.json
+++ b/src/api/demo/tsconfig.json
@@ -1,6 +1,6 @@
{
"compilerOptions": {
- "target": "es5",
+ "target": "ES2020",
"lib": [
"dom",
"dom.iterable",
@@ -8,7 +8,8 @@
],
"allowJs": true,
"skipLibCheck": true,
- "strict": false,
+ "strict": true,
+ "noImplicitAny": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
@@ -16,7 +17,11 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
- "jsx": "preserve"
+ "jsx": "preserve",
+ "types": [
+ "bun-types"
+ ],
+ "incremental": true
},
"include": [
"next-env.d.ts",
@@ -26,4 +31,4 @@
"exclude": [
"node_modules"
]
-}
+} \ No newline at end of file
diff --git a/src/api/package.json b/src/api/package.json
index 9df4297df..8a9f3064a 100644
--- a/src/api/package.json
+++ b/src/api/package.json
@@ -2,6 +2,6 @@
"name": "bun-api",
"private": true,
"dependencies": {
- "peechy": "latest"
+ "peechy": "0.4.32"
}
}
diff --git a/src/api/schema.d.ts b/src/api/schema.d.ts
index d9713fdd2..8eb7a77f2 100644
--- a/src/api/schema.d.ts
+++ b/src/api/schema.d.ts
@@ -704,29 +704,29 @@ export interface BunInstall {
export declare function encodeStackFrame(
message: StackFrame,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeStackFrame(buffer: ByteBuffer): StackFrame;
export declare function encodeStackFramePosition(
message: StackFramePosition,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeStackFramePosition(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): StackFramePosition;
export declare function encodeSourceLine(
message: SourceLine,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeSourceLine(buffer: ByteBuffer): SourceLine;
export declare function encodeStackTrace(
message: StackTrace,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeStackTrace(buffer: ByteBuffer): StackTrace;
export declare function encodeJSException(
message: JSException,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeJSException(buffer: ByteBuffer): JSException;
export declare function encodeProblems(message: Problems, bb: ByteBuffer): void;
@@ -735,175 +735,175 @@ export declare function encodeRouter(message: Router, bb: ByteBuffer): void;
export declare function decodeRouter(buffer: ByteBuffer): Router;
export declare function encodeFallbackMessageContainer(
message: FallbackMessageContainer,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFallbackMessageContainer(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): FallbackMessageContainer;
export declare function encodeJSX(message: JSX, bb: ByteBuffer): void;
export declare function decodeJSX(buffer: ByteBuffer): JSX;
export declare function encodeStringPointer(
message: StringPointer,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeStringPointer(buffer: ByteBuffer): StringPointer;
export declare function encodeJavascriptBundledModule(
message: JavascriptBundledModule,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeJavascriptBundledModule(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): JavascriptBundledModule;
export declare function encodeJavascriptBundledPackage(
message: JavascriptBundledPackage,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeJavascriptBundledPackage(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): JavascriptBundledPackage;
export declare function encodeJavascriptBundle(
message: JavascriptBundle,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeJavascriptBundle(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): JavascriptBundle;
export declare function encodeJavascriptBundleContainer(
message: JavascriptBundleContainer,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeJavascriptBundleContainer(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): JavascriptBundleContainer;
export declare function encodeModuleImportRecord(
message: ModuleImportRecord,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeModuleImportRecord(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): ModuleImportRecord;
export declare function encodeModule(message: Module, bb: ByteBuffer): void;
export declare function decodeModule(buffer: ByteBuffer): Module;
export declare function encodeStringMap(
message: StringMap,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeStringMap(buffer: ByteBuffer): StringMap;
export declare function encodeLoaderMap(
message: LoaderMap,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeLoaderMap(buffer: ByteBuffer): LoaderMap;
export declare function encodeEnvConfig(
message: EnvConfig,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeEnvConfig(buffer: ByteBuffer): EnvConfig;
export declare function encodeLoadedEnvConfig(
message: LoadedEnvConfig,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeLoadedEnvConfig(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): LoadedEnvConfig;
export declare function encodeFrameworkConfig(
message: FrameworkConfig,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFrameworkConfig(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): FrameworkConfig;
export declare function encodeFrameworkEntryPoint(
message: FrameworkEntryPoint,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFrameworkEntryPoint(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): FrameworkEntryPoint;
export declare function encodeFrameworkEntryPointMap(
message: FrameworkEntryPointMap,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFrameworkEntryPointMap(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): FrameworkEntryPointMap;
export declare function encodeFrameworkEntryPointMessage(
message: FrameworkEntryPointMessage,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFrameworkEntryPointMessage(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): FrameworkEntryPointMessage;
export declare function encodeLoadedFramework(
message: LoadedFramework,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeLoadedFramework(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): LoadedFramework;
export declare function encodeLoadedRouteConfig(
message: LoadedRouteConfig,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeLoadedRouteConfig(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): LoadedRouteConfig;
export declare function encodeRouteConfig(
message: RouteConfig,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeRouteConfig(buffer: ByteBuffer): RouteConfig;
export declare function encodeTransformOptions(
message: TransformOptions,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeTransformOptions(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): TransformOptions;
export declare function encodeFileHandle(
message: FileHandle,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeFileHandle(buffer: ByteBuffer): FileHandle;
export declare function encodeTransform(
message: Transform,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeTransform(buffer: ByteBuffer): Transform;
export declare function encodeScan(message: Scan, bb: ByteBuffer): void;
export declare function decodeScan(buffer: ByteBuffer): Scan;
export declare function encodeScanResult(
message: ScanResult,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeScanResult(buffer: ByteBuffer): ScanResult;
export declare function encodeScannedImport(
message: ScannedImport,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeScannedImport(buffer: ByteBuffer): ScannedImport;
export declare function encodeOutputFile(
message: OutputFile,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeOutputFile(buffer: ByteBuffer): OutputFile;
export declare function encodeTransformResponse(
message: TransformResponse,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeTransformResponse(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): TransformResponse;
export declare function encodeLocation(message: Location, bb: ByteBuffer): void;
export declare function decodeLocation(buffer: ByteBuffer): Location;
export declare function encodeMessageData(
message: MessageData,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeMessageData(buffer: ByteBuffer): MessageData;
export declare function encodeMessageMeta(
message: MessageMeta,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeMessageMeta(buffer: ByteBuffer): MessageMeta;
export declare function encodeMessage(message: Message, bb: ByteBuffer): void;
@@ -912,88 +912,88 @@ export declare function encodeLog(message: Log, bb: ByteBuffer): void;
export declare function decodeLog(buffer: ByteBuffer): Log;
export declare function encodeWebsocketMessage(
message: WebsocketMessage,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessage(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessage;
export declare function encodeWebsocketMessageWelcome(
message: WebsocketMessageWelcome,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessageWelcome(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessageWelcome;
export declare function encodeWebsocketMessageFileChangeNotification(
message: WebsocketMessageFileChangeNotification,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessageFileChangeNotification(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessageFileChangeNotification;
export declare function encodeWebsocketCommand(
message: WebsocketCommand,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketCommand(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketCommand;
export declare function encodeWebsocketCommandBuild(
message: WebsocketCommandBuild,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketCommandBuild(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketCommandBuild;
export declare function encodeWebsocketCommandManifest(
message: WebsocketCommandManifest,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketCommandManifest(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketCommandManifest;
export declare function encodeWebsocketMessageBuildSuccess(
message: WebsocketMessageBuildSuccess,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessageBuildSuccess(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessageBuildSuccess;
export declare function encodeWebsocketMessageBuildFailure(
message: WebsocketMessageBuildFailure,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessageBuildFailure(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessageBuildFailure;
export declare function encodeWebsocketCommandBuildWithFilePath(
message: WebsocketCommandBuildWithFilePath,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketCommandBuildWithFilePath(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketCommandBuildWithFilePath;
export declare function encodeWebsocketMessageResolveID(
message: WebsocketMessageResolveID,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeWebsocketMessageResolveID(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): WebsocketMessageResolveID;
export declare function encodeNPMRegistry(
message: NPMRegistry,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeNPMRegistry(buffer: ByteBuffer): NPMRegistry;
export declare function encodeNPMRegistryMap(
message: NPMRegistryMap,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeNPMRegistryMap(
- buffer: ByteBuffer
+ buffer: ByteBuffer,
): NPMRegistryMap;
export declare function encodeBunInstall(
message: BunInstall,
- bb: ByteBuffer
+ bb: ByteBuffer,
): void;
export declare function decodeBunInstall(buffer: ByteBuffer): BunInstall;
diff --git a/src/api/schema.js b/src/api/schema.js
index ac28f56ab..c78693df8 100644
--- a/src/api/schema.js
+++ b/src/api/schema.js
@@ -124,7 +124,9 @@ function encodeStackFrame(message, bb) {
var encoded = StackFrameScope[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "StackFrameScope"'
+ "Invalid value " +
+ JSON.stringify(value) +
+ ' for enum "StackFrameScope"',
);
bb.writeByte(encoded);
} else {
@@ -504,7 +506,7 @@ function encodeFallbackMessageContainer(message, bb) {
var encoded = FallbackStep[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "FallbackStep"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "FallbackStep"',
);
bb.writeByte(encoded);
}
@@ -620,7 +622,7 @@ function encodeJSX(message, bb) {
var encoded = JSXRuntime[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "JSXRuntime"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "JSXRuntime"',
);
bb.writeByte(encoded);
} else {
@@ -841,7 +843,7 @@ function encodeJavascriptBundle(message, bb) {
bb.writeByteArray(value);
} else {
throw new Error(
- 'Missing required field "app_package_json_dependencies_hash"'
+ 'Missing required field "app_package_json_dependencies_hash"',
);
}
@@ -968,7 +970,7 @@ function encodeModuleImportRecord(message, bb) {
throw new Error(
"Invalid value " +
JSON.stringify(value) +
- ' for enum "ModuleImportType"'
+ ' for enum "ModuleImportType"',
);
bb.writeByte(encoded);
} else {
@@ -1098,7 +1100,7 @@ function encodeLoaderMap(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
}
@@ -1175,7 +1177,7 @@ function encodeLoadedEnvConfig(message, bb) {
var encoded = DotEnvBehavior[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "DotEnvBehavior"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "DotEnvBehavior"',
);
bb.writeVarUint(encoded);
} else {
@@ -1280,7 +1282,9 @@ function encodeFrameworkConfig(message, bb) {
var encoded = CSSInJSBehavior[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "CSSInJSBehavior"'
+ "Invalid value " +
+ JSON.stringify(value) +
+ ' for enum "CSSInJSBehavior"',
);
bb.writeByte(encoded);
}
@@ -1316,7 +1320,7 @@ function encodeFrameworkEntryPoint(message, bb) {
throw new Error(
"Invalid value " +
JSON.stringify(value) +
- ' for enum "FrameworkEntryPointType"'
+ ' for enum "FrameworkEntryPointType"',
);
bb.writeByte(encoded);
} else {
@@ -1468,7 +1472,9 @@ function encodeLoadedFramework(message, bb) {
var encoded = CSSInJSBehavior[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "CSSInJSBehavior"'
+ "Invalid value " +
+ JSON.stringify(value) +
+ ' for enum "CSSInJSBehavior"',
);
bb.writeByte(encoded);
} else {
@@ -1755,7 +1761,7 @@ function encodeTransformOptions(message, bb) {
var encoded = ResolveMode[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "ResolveMode"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "ResolveMode"',
);
bb.writeByte(encoded);
}
@@ -1856,7 +1862,7 @@ function encodeTransformOptions(message, bb) {
var encoded = Platform[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Platform"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Platform"',
);
bb.writeByte(encoded);
}
@@ -1933,7 +1939,7 @@ function encodeTransformOptions(message, bb) {
var encoded = MessageLevel[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "MessageLevel"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "MessageLevel"',
);
bb.writeVarUint(encoded);
}
@@ -1944,7 +1950,7 @@ function encodeTransformOptions(message, bb) {
var encoded = SourceMapMode[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "SourceMapMode"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "SourceMapMode"',
);
bb.writeByte(encoded);
}
@@ -2054,7 +2060,7 @@ function encodeTransform(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
}
@@ -2112,7 +2118,7 @@ function encodeScan(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
}
@@ -2180,7 +2186,7 @@ function encodeScannedImport(message, bb) {
var encoded = ImportKind[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "ImportKind"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "ImportKind"',
);
bb.writeByte(encoded);
} else {
@@ -2281,7 +2287,7 @@ function encodeTransformResponse(message, bb) {
throw new Error(
"Invalid value " +
JSON.stringify(value) +
- ' for enum "TransformResponseStatus"'
+ ' for enum "TransformResponseStatus"',
);
bb.writeVarUint(encoded);
} else {
@@ -2495,7 +2501,7 @@ function encodeMessage(message, bb) {
var encoded = MessageLevel[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "MessageLevel"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "MessageLevel"',
);
bb.writeVarUint(encoded);
} else {
@@ -2661,7 +2667,7 @@ function encodeWebsocketMessage(message, bb) {
throw new Error(
"Invalid value " +
JSON.stringify(value) +
- ' for enum "WebsocketMessageKind"'
+ ' for enum "WebsocketMessageKind"',
);
bb.writeByte(encoded);
} else {
@@ -2692,7 +2698,7 @@ function encodeWebsocketMessageWelcome(message, bb) {
var encoded = Reloader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Reloader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Reloader"',
);
bb.writeByte(encoded);
} else {
@@ -2735,7 +2741,7 @@ function encodeWebsocketMessageFileChangeNotification(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
} else {
@@ -2759,7 +2765,7 @@ function encodeWebsocketCommand(message, bb) {
throw new Error(
"Invalid value " +
JSON.stringify(value) +
- ' for enum "WebsocketCommandKind"'
+ ' for enum "WebsocketCommandKind"',
);
bb.writeByte(encoded);
} else {
@@ -2837,7 +2843,7 @@ function encodeWebsocketMessageBuildSuccess(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
} else {
@@ -2890,7 +2896,7 @@ function encodeWebsocketMessageBuildFailure(message, bb) {
var encoded = Loader[value];
if (encoded === void 0)
throw new Error(
- "Invalid value " + JSON.stringify(value) + ' for enum "Loader"'
+ "Invalid value " + JSON.stringify(value) + ' for enum "Loader"',
);
bb.writeByte(encoded);
} else {
diff --git a/src/bun.js/assert.exports.js b/src/bun.js/assert.exports.js
index 92efee5be..9e82fa72b 100644
--- a/src/bun.js/assert.exports.js
+++ b/src/bun.js/assert.exports.js
@@ -32,10 +32,10 @@ var __reExport = (target, module2, desc) => {
"default",
module2 && module2.__esModule && "default" in module2
? { get: () => module2.default, enumerable: !0 }
- : { value: module2, enumerable: !0 }
- )
+ : { value: module2, enumerable: !0 },
+ ),
),
- module2
+ module2,
);
var require = (path) => import.meta.require(path);
@@ -73,7 +73,7 @@ var require_errors = __commonJS({
function _assertThisInitialized(self) {
if (self === void 0)
throw new ReferenceError(
- "this hasn't been initialised - super() hasn't been called"
+ "this hasn't been initialised - super() hasn't been called",
);
return self;
}
@@ -90,7 +90,7 @@ var require_errors = __commonJS({
function _inherits(subClass, superClass) {
if (typeof superClass != "function" && superClass !== null)
throw new TypeError(
- "Super expression must either be null or a function"
+ "Super expression must either be null or a function",
);
(subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: { value: subClass, writable: !0, configurable: !0 },
@@ -125,8 +125,8 @@ var require_errors = __commonJS({
this,
_getPrototypeOf(NodeError2).call(
this,
- getMessage(arg1, arg2, arg3)
- )
+ getMessage(arg1, arg2, arg3),
+ ),
)),
(_this.code = code),
_this
@@ -178,7 +178,7 @@ var require_errors = __commonJS({
createErrorType(
"ERR_AMBIGUOUS_ARGUMENT",
'The "%s" argument is ambiguous. %s',
- TypeError
+ TypeError,
);
createErrorType(
"ERR_INVALID_ARG_TYPE",
@@ -206,7 +206,7 @@ var require_errors = __commonJS({
}
return (msg += ". Received type ".concat(_typeof(actual))), msg;
},
- TypeError
+ TypeError,
);
createErrorType(
"ERR_INVALID_ARG_VALUE",
@@ -227,7 +227,7 @@ var require_errors = __commonJS({
);
},
TypeError,
- RangeError
+ RangeError,
);
createErrorType(
"ERR_INVALID_RETURN_VALUE",
@@ -242,7 +242,7 @@ var require_errors = __commonJS({
.concat(name, '"') + " function but got ".concat(type, ".")
);
},
- TypeError
+ TypeError,
);
createErrorType(
"ERR_MISSING_ARGS",
@@ -276,7 +276,7 @@ var require_errors = __commonJS({
}
return "".concat(msg, " must be specified");
},
- TypeError
+ TypeError,
);
module2.exports.codes = codes;
},
@@ -294,7 +294,7 @@ var require_assertion_error = __commonJS({
(ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
- })
+ }),
)),
ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
@@ -343,14 +343,14 @@ var require_assertion_error = __commonJS({
function _assertThisInitialized(self) {
if (self === void 0)
throw new ReferenceError(
- "this hasn't been initialised - super() hasn't been called"
+ "this hasn't been initialised - super() hasn't been called",
);
return self;
}
function _inherits(subClass, superClass) {
if (typeof superClass != "function" && superClass !== null)
throw new TypeError(
- "Super expression must either be null or a function"
+ "Super expression must either be null or a function",
);
(subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: { value: subClass, writable: !0, configurable: !0 },
@@ -364,7 +364,7 @@ var require_assertion_error = __commonJS({
if (Class2 === null || !_isNativeFunction(Class2)) return Class2;
if (typeof Class2 != "function")
throw new TypeError(
- "Super expression must either be null or a function"
+ "Super expression must either be null or a function",
);
if (typeof _cache != "undefined") {
if (_cache.has(Class2)) return _cache.get(Class2);
@@ -374,7 +374,7 @@ var require_assertion_error = __commonJS({
return _construct(
Class2,
arguments,
- _getPrototypeOf(this).constructor
+ _getPrototypeOf(this).constructor,
);
}
return (
@@ -403,7 +403,7 @@ var require_assertion_error = __commonJS({
try {
return (
Date.prototype.toString.call(
- Reflect.construct(Date, [], function () {})
+ Reflect.construct(Date, [], function () {}),
),
!0
);
@@ -569,12 +569,12 @@ var require_assertion_error = __commonJS({
kReadableOperator[operator],
`
-`
+`,
) +
"".concat(actualLines[0], " !== ").concat(
expectedLines[0],
`
-`
+`,
)
);
} else if (operator !== "strictEqualObject") {
@@ -624,13 +624,13 @@ var require_assertion_error = __commonJS({
kReadableOperator.notIdentical,
`
-`
+`,
)
.concat(
_actualLines.join(`
`),
`
-`
+`,
);
}
i > 3 &&
@@ -757,19 +757,19 @@ var require_assertion_error = __commonJS({
.concat(
skippedMsg,
`
-`
+`,
)
.concat(
res,
`
-`
+`,
)
.concat(blue, "...")
.concat(white)
.concat(
other,
`
-`
+`,
) + "".concat(blue, "...").concat(white)
);
}
@@ -778,7 +778,7 @@ var require_assertion_error = __commonJS({
.concat(
skipped ? skippedMsg : "",
`
-`
+`,
)
.concat(res)
.concat(other)
@@ -803,7 +803,7 @@ var require_assertion_error = __commonJS({
if (((Error.stackTraceLimit = 0), message != null))
_this = _possibleConstructorReturn(
this,
- _getPrototypeOf(AssertionError2).call(this, String(message))
+ _getPrototypeOf(AssertionError2).call(this, String(message)),
);
else if (
(process.stderr &&
@@ -828,8 +828,8 @@ var require_assertion_error = __commonJS({
this,
_getPrototypeOf(AssertionError2).call(
this,
- createErrDiff(actual, expected, operator)
- )
+ createErrDiff(actual, expected, operator),
+ ),
);
else if (
operator === "notDeepStrictEqual" ||
@@ -856,8 +856,8 @@ var require_assertion_error = __commonJS({
this,
_getPrototypeOf(AssertionError2).call(
this,
- "".concat(base, " ").concat(res[0])
- )
+ "".concat(base, " ").concat(res[0]),
+ ),
))
: (_this = _possibleConstructorReturn(
this,
@@ -868,15 +868,15 @@ var require_assertion_error = __commonJS({
base,
`
-`
+`,
)
.concat(
res.join(`
`),
`
-`
- )
- )
+`,
+ ),
+ ),
));
} else {
var _res = inspectValue(actual),
@@ -888,7 +888,7 @@ var require_assertion_error = __commonJS({
kReadableOperator[operator],
`
-`
+`,
)
.concat(_res)),
_res.length > 1024 &&
@@ -904,7 +904,7 @@ var require_assertion_error = __commonJS({
knownOperators,
`
-`
+`,
)
.concat(
_res,
@@ -912,15 +912,15 @@ var require_assertion_error = __commonJS({
should equal
-`
+`,
))
: (other = " ".concat(operator, " ").concat(other))),
(_this = _possibleConstructorReturn(
this,
_getPrototypeOf(AssertionError2).call(
this,
- "".concat(_res).concat(other)
- )
+ "".concat(_res).concat(other),
+ ),
));
}
return (
@@ -939,7 +939,7 @@ should equal
Error.captureStackTrace &&
Error.captureStackTrace(
_assertThisInitialized(_this),
- stackStartFn
+ stackStartFn,
),
_this.stack,
(_this.name = "AssertionError"),
@@ -965,7 +965,7 @@ should equal
_objectSpread({}, ctx, {
customInspect: !1,
depth: 0,
- })
+ }),
);
},
},
@@ -1280,7 +1280,7 @@ var require_implementation2 = __commonJS({
if (this instanceof bound) {
var result = target.apply(
this,
- args.concat(slice.call(arguments))
+ args.concat(slice.call(arguments)),
);
return Object(result) === result ? result : this;
} else
@@ -1298,7 +1298,7 @@ var require_implementation2 = __commonJS({
"binder",
"return function (" +
boundArgs.join(",") +
- "){ return binder.apply(this,arguments); }"
+ "){ return binder.apply(this,arguments); }",
)(binder)),
target.prototype)
) {
@@ -1341,7 +1341,7 @@ var require_get_intrinsic = __commonJS({
getEvalledConstructor = function (expressionSyntax) {
try {
return $Function(
- '"use strict"; return (' + expressionSyntax + ").constructor;"
+ '"use strict"; return (' + expressionSyntax + ").constructor;",
)();
} catch {}
},
@@ -1562,11 +1562,11 @@ var require_get_intrinsic = __commonJS({
last = $strSlice(string, -1);
if (first === "%" && last !== "%")
throw new $SyntaxError(
- "invalid intrinsic syntax, expected closing `%`"
+ "invalid intrinsic syntax, expected closing `%`",
);
if (last === "%" && first !== "%")
throw new $SyntaxError(
- "invalid intrinsic syntax, expected opening `%`"
+ "invalid intrinsic syntax, expected opening `%`",
);
var result = [];
return (
@@ -1577,7 +1577,7 @@ var require_get_intrinsic = __commonJS({
result[result.length] = quote
? $replace(subString, reEscapeChar, "$1")
: number || match;
- }
+ },
),
result
);
@@ -1599,7 +1599,7 @@ var require_get_intrinsic = __commonJS({
throw new $TypeError(
"intrinsic " +
name +
- " exists, but is not available. Please file an issue!"
+ " exists, but is not available. Please file an issue!",
);
return {
alias,
@@ -1616,13 +1616,13 @@ var require_get_intrinsic = __commonJS({
throw new $TypeError('"allowMissing" argument must be a boolean');
if ($exec(/^%?[^%]*%?$/g, name) === null)
throw new $SyntaxError(
- "`%` may not be present anywhere but at the beginning and end of the intrinsic name"
+ "`%` may not be present anywhere but at the beginning and end of the intrinsic name",
);
var parts = stringToPath(name),
intrinsicBaseName = parts.length > 0 ? parts[0] : "",
intrinsic = getBaseIntrinsic(
"%" + intrinsicBaseName + "%",
- allowMissing
+ allowMissing,
),
intrinsicRealName = intrinsic.name,
value = intrinsic.value,
@@ -1645,7 +1645,7 @@ var require_get_intrinsic = __commonJS({
first !== last
)
throw new $SyntaxError(
- "property names with quotes must have matching quotes"
+ "property names with quotes must have matching quotes",
);
if (
((part === "constructor" || !isOwn) && (skipFurtherCaching = !0),
@@ -1660,7 +1660,7 @@ var require_get_intrinsic = __commonJS({
throw new $TypeError(
"base intrinsic for " +
name +
- " exists, but the property is not available."
+ " exists, but the property is not available.",
);
return;
}
@@ -1831,7 +1831,7 @@ var require_shim = __commonJS({
is: function () {
return Object.is !== polyfill;
},
- }
+ },
),
polyfill
);
@@ -1897,7 +1897,7 @@ var require_shim2 = __commonJS({
isNaN: function () {
return Number.isNaN !== polyfill;
},
- }
+ },
),
polyfill
);
@@ -1937,7 +1937,7 @@ var require_comparisons = __commonJS({
}
function _nonIterableRest() {
throw new TypeError(
- "Invalid attempt to destructure non-iterable instance"
+ "Invalid attempt to destructure non-iterable instance",
);
}
function _iterableToArrayLimit(arr, i) {
@@ -2044,8 +2044,8 @@ var require_comparisons = __commonJS({
.filter(isNonIndex)
.concat(
objectGetOwnPropertySymbols(value).filter(
- Object.prototype.propertyIsEnumerable.bind(value)
- )
+ Object.prototype.propertyIsEnumerable.bind(value),
+ ),
);
}
function compare(a, b) {
@@ -2085,7 +2085,7 @@ var require_comparisons = __commonJS({
? !1
: compare(
new Uint8Array(a.buffer, a.byteOffset, a.byteLength),
- new Uint8Array(b.buffer, b.byteOffset, b.byteLength)
+ new Uint8Array(b.buffer, b.byteOffset, b.byteLength),
) === 0;
}
function areEqualArrayBuffers(buf1, buf2) {
@@ -2099,7 +2099,7 @@ var require_comparisons = __commonJS({
? isNumberObject(val2) &&
objectIs(
Number.prototype.valueOf.call(val1),
- Number.prototype.valueOf.call(val2)
+ Number.prototype.valueOf.call(val2),
)
: isStringObject(val1)
? isStringObject(val2) &&
@@ -2503,7 +2503,7 @@ var require_assert = __commonJS({
warn(
"assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.",
"DeprecationWarning",
- "DEP0094"
+ "DEP0094",
);
}
argsLen === 2 && (operator = "!=");
@@ -2605,7 +2605,7 @@ var require_assert = __commonJS({
assert.deepStrictEqual = function deepStrictEqual(
actual,
expected,
- message
+ message,
) {
if (arguments.length < 2)
throw new ERR_MISSING_ARGS("actual", "expected");
@@ -2704,7 +2704,7 @@ var require_assert = __commonJS({
throw new ERR_INVALID_ARG_TYPE(
"expected",
["Function", "RegExp"],
- expected
+ expected,
);
if (_typeof(actual) !== "object" || actual === null) {
var err = new AssertionError({
@@ -2722,7 +2722,7 @@ var require_assert = __commonJS({
throw new ERR_INVALID_ARG_VALUE(
"error",
expected,
- "may not be an empty object"
+ "may not be an empty object",
);
return (
isDeepEqual === void 0 && lazyLoadComparison(),
@@ -2768,14 +2768,14 @@ var require_assert = __commonJS({
throw new ERR_INVALID_RETURN_VALUE(
"instance of Promise",
"promiseFn",
- resultPromise
+ resultPromise,
);
} else if (checkIsPromise(promiseFn)) resultPromise = promiseFn;
else
throw new ERR_INVALID_ARG_TYPE(
"promiseFn",
["Function", "Promise"],
- promiseFn
+ promiseFn,
);
return Promise.resolve()
.then(function () {
@@ -2795,7 +2795,7 @@ var require_assert = __commonJS({
throw new ERR_INVALID_ARG_TYPE(
"error",
["Object", "Error", "Function", "RegExp"],
- error
+ error,
);
if (_typeof(actual) === "object" && actual !== null) {
if (actual.message === error)
@@ -2803,13 +2803,13 @@ var require_assert = __commonJS({
"error/message",
'The error message "'.concat(
actual.message,
- '" is identical to the message.'
- )
+ '" is identical to the message.',
+ ),
);
} else if (actual === error)
throw new ERR_AMBIGUOUS_ARGUMENT(
"error/message",
- 'The error "'.concat(actual, '" is identical to the message.')
+ 'The error "'.concat(actual, '" is identical to the message.'),
);
(message = error), (error = void 0);
} else if (
@@ -2820,7 +2820,7 @@ var require_assert = __commonJS({
throw new ERR_INVALID_ARG_TYPE(
"error",
["Object", "Error", "Function", "RegExp"],
- error
+ error,
);
if (actual === NO_EXCEPTION_SENTINEL) {
var details = "";
@@ -2856,7 +2856,7 @@ var require_assert = __commonJS({
"Got unwanted ".concat(fnType).concat(
details,
`
-`
+`,
) + 'Actual message: "'.concat(actual && actual.message, '"'),
stackStartFn,
});
@@ -2911,7 +2911,7 @@ var require_assert = __commonJS({
return waitForActual(fn).then(function (result) {
return expectsNoError.apply(
void 0,
- [doesNotReject, result].concat(args)
+ [doesNotReject, result].concat(args),
);
});
};
@@ -2953,11 +2953,11 @@ var require_assert = __commonJS({
tmp1.join(`
`),
`
-`
+`,
)
.concat(
tmp2.join(`
-`)
+`),
);
}
throw newErr;
diff --git a/src/bun.js/bindings/sqlite/sqlite.exports.js b/src/bun.js/bindings/sqlite/sqlite.exports.js
index 6c1bf803d..875e28ff1 100644
--- a/src/bun.js/bindings/sqlite/sqlite.exports.js
+++ b/src/bun.js/bindings/sqlite/sqlite.exports.js
@@ -3,7 +3,7 @@ var symbolFor = Symbol.for;
const lazy = globalThis[symbolFor("Bun.lazy")];
if (!lazy || typeof lazy !== "function") {
throw new Error(
- "Something went wrong while loading Bun. Expected 'Bun.lazy' to be defined."
+ "Something went wrong while loading Bun. Expected 'Bun.lazy' to be defined.",
);
}
@@ -185,14 +185,14 @@ export class Database {
filenameGiven,
typeof options === "object" && options
? !!options.readonly
- : ((options | 0) & constants.SQLITE_OPEN_READONLY) != 0
+ : ((options | 0) & constants.SQLITE_OPEN_READONLY) != 0,
);
this.filename = ":memory:";
return;
}
throw new TypeError(
- `Expected 'filename' to be a string, got '${typeof filenameGiven}'`
+ `Expected 'filename' to be a string, got '${typeof filenameGiven}'`,
);
}
@@ -208,7 +208,7 @@ export class Database {
if ("readOnly" in options)
throw new TypeError(
- 'Misspelled option "readOnly" should be "readonly"'
+ 'Misspelled option "readOnly" should be "readonly"',
);
if (options.create) {
@@ -316,7 +316,7 @@ export class Database {
query(query) {
if (typeof query !== "string") {
throw new TypeError(
- `Expected 'query' to be a string, got '${typeof query}'`
+ `Expected 'query' to be a string, got '${typeof query}'`,
);
}
@@ -337,7 +337,7 @@ export class Database {
return (this.#cachedQueriesValues[index] = this.prepare(
query,
undefined,
- willCache ? constants.SQLITE_PREPARE_PERSISTENT : 0
+ willCache ? constants.SQLITE_PREPARE_PERSISTENT : 0,
));
}
return stmt;
@@ -349,7 +349,7 @@ export class Database {
var stmt = this.prepare(
query,
undefined,
- willCache ? constants.SQLITE_PREPARE_PERSISTENT : 0
+ willCache ? constants.SQLITE_PREPARE_PERSISTENT : 0,
);
if (willCache) {
@@ -413,21 +413,21 @@ const getController = (db, self) => {
(controller = {
default: Object.assign(
{ begin: db.prepare("BEGIN", undefined, 0) },
- shared
+ shared,
),
deferred: Object.assign(
{ begin: db.prepare("BEGIN DEFERRED", undefined, 0) },
- shared
+ shared,
),
immediate: Object.assign(
{ begin: db.prepare("BEGIN IMMEDIATE", undefined, 0) },
- shared
+ shared,
),
exclusive: Object.assign(
{ begin: db.prepare("BEGIN EXCLUSIVE", undefined, 0) },
- shared
+ shared,
),
- })
+ }),
);
}
return controller;
@@ -437,7 +437,7 @@ const getController = (db, self) => {
const wrapTransaction = (
fn,
db,
- { begin, commit, rollback, savepoint, release, rollbackTo }
+ { begin, commit, rollback, savepoint, release, rollbackTo },
) =>
function transaction(...args) {
let before, after, undo;
diff --git a/src/bun.js/child_process.exports.js b/src/bun.js/child_process.exports.js
index eff7bfca0..5295152dc 100644
--- a/src/bun.js/child_process.exports.js
+++ b/src/bun.js/child_process.exports.js
@@ -137,7 +137,7 @@ export function spawn(file, args, options) {
} else {
signal.addEventListener("abort", onAbortListener, { once: true });
child.once("exit", () =>
- signal.removeEventListener("abort", onAbortListener)
+ signal.removeEventListener("abort", onAbortListener),
);
}
@@ -178,7 +178,7 @@ export function execFile(file, args, options, callback) {
file,
args,
options,
- callback
+ callback,
));
options = {
@@ -332,7 +332,7 @@ export function execFile(file, args, options, callback) {
const truncatedLen = maxBuffer - (encodedStdoutLen - actualLen);
ArrayPrototypePush.call(
_stdout,
- StringPrototypeSlice.apply(chunk, 0, truncatedLen)
+ StringPrototypeSlice.apply(chunk, 0, truncatedLen),
);
ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER("stdout");
@@ -353,7 +353,7 @@ export function execFile(file, args, options, callback) {
} else {
ArrayPrototypePush.call(_stdout, chunk);
}
- }
+ },
);
}
@@ -383,7 +383,7 @@ export function execFile(file, args, options, callback) {
const truncatedLen = maxBuffer - (encodedStderrLen - actualLen);
ArrayPrototypePush.call(
_stderr,
- StringPrototypeSlice.call(chunk, 0, truncatedLen)
+ StringPrototypeSlice.call(chunk, 0, truncatedLen),
);
ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER("stderr");
@@ -399,7 +399,7 @@ export function execFile(file, args, options, callback) {
const truncatedLen = maxBuffer - (stderrLen - chunk.length);
ArrayPrototypePush.call(
_stderr,
- StringPrototypeSlice.call(chunk, 0, truncatedLen)
+ StringPrototypeSlice.call(chunk, 0, truncatedLen),
);
ex = new ERR_CHILD_PROCESS_STDIO_MAXBUFFER("stderr");
@@ -407,7 +407,7 @@ export function execFile(file, args, options, callback) {
} else {
ArrayPrototypePush.call(_stderr, chunk);
}
- }
+ },
);
}
@@ -651,7 +651,7 @@ function sanitizeKillSignal(killSignal) {
throw new ERR_INVALID_ARG_TYPE(
"options.killSignal",
["string", "number"],
- killSignal
+ killSignal,
);
}
}
@@ -771,7 +771,7 @@ function normalizeSpawnArguments(file, args, options) {
throw new ERR_INVALID_ARG_TYPE(
"options.shell",
["boolean", "string"],
- options.shell
+ options.shell,
);
}
@@ -1257,7 +1257,7 @@ function validateMaxBuffer(maxBuffer) {
throw new ERR_OUT_OF_RANGE(
"options.maxBuffer",
"a positive number",
- maxBuffer
+ maxBuffer,
);
}
}
@@ -1267,7 +1267,7 @@ function validateArgumentNullCheck(arg, propName) {
throw new ERR_INVALID_ARG_VALUE(
propName,
arg,
- "must be a string without null bytes"
+ "must be a string without null bytes",
);
}
}
@@ -1332,9 +1332,9 @@ const validateOneOf = (value, name, oneOf) => {
if (!ArrayPrototypeIncludes.call(oneOf, value)) {
const allowed = ArrayPrototypeJoin.call(
ArrayPrototypeMap.call(oneOf, (v) =>
- typeof v === "string" ? `'${v}'` : String(v)
+ typeof v === "string" ? `'${v}'` : String(v),
),
- ", "
+ ", ",
);
const reason = "must be one of: " + allowed;
throw new ERR_INVALID_ARG_VALUE(name, value, reason);
@@ -1417,7 +1417,7 @@ function nullCheck(path, propName, throwError = true) {
const err = new ERR_INVALID_ARG_VALUE(
propName,
path,
- "must be a string or Uint8Array without null bytes"
+ "must be a string or Uint8Array without null bytes",
);
if (throwError) {
throw err;
@@ -1672,7 +1672,7 @@ function ERR_OUT_OF_RANGE(str, range, input, replaceDefaultBoolean = false) {
// msg += ` It must be ${range}. Received ${received}`;
// return new RangeError(msg);
return new RangeError(
- `The value of ${str} is out of range. It must be ${range}. Received ${input}`
+ `The value of ${str} is out of range. It must be ${range}. Received ${input}`,
);
}
@@ -1688,7 +1688,7 @@ function ERR_UNKNOWN_SIGNAL(name) {
function ERR_INVALID_ARG_TYPE(name, type, value) {
const err = new TypeError(
- `The "${name}" argument must be of type ${type}. Received ${value}`
+ `The "${name}" argument must be of type ${type}. Received ${value}`,
);
err.code = "ERR_INVALID_ARG_TYPE";
return err;
@@ -1700,7 +1700,7 @@ function ERR_INVALID_OPT_VALUE(name, value) {
function ERR_INVALID_ARG_VALUE(name, value, reason) {
return new Error(
- `The value "${value}" is invalid for argument '${name}'. Reason: ${reason}`
+ `The value "${value}" is invalid for argument '${name}'. Reason: ${reason}`,
);
}
diff --git a/src/bun.js/depd.exports.js b/src/bun.js/depd.exports.js
index 04ed01555..b6164bf02 100644
--- a/src/bun.js/depd.exports.js
+++ b/src/bun.js/depd.exports.js
@@ -38,7 +38,7 @@ var __toESM = (mod, isNodeMode, target) => (
isNodeMode || !mod || !mod.__esModule
? __defProp(target, "default", { value: mod, enumerable: true })
: target,
- mod
+ mod,
)
);
diff --git a/src/bun.js/ffi.exports.js b/src/bun.js/ffi.exports.js
index 67ad97287..ec553b7d5 100644
--- a/src/bun.js/ffi.exports.js
+++ b/src/bun.js/ffi.exports.js
@@ -54,7 +54,7 @@ export class CString extends String {
? typeof byteLength === "number" && Number.isSafeInteger(byteLength)
? new BunCString(ptr, byteOffset || 0, byteLength)
: new BunCString(ptr)
- : ""
+ : "",
);
this.ptr = typeof ptr === "number" ? ptr : 0;
if (typeof byteOffset !== "undefined") {
@@ -82,7 +82,7 @@ export class CString extends String {
return (this.#cachedArrayBuffer = toArrayBuffer(
this.ptr,
this.byteOffset,
- this.byteLength
+ this.byteLength,
));
}
}
@@ -209,7 +209,7 @@ Object.defineProperty(globalThis, "__GlobalBunFFIPtrFunctionForWrapper", {
});
ffiWrappers[FFIType.cstring] = ffiWrappers[FFIType.pointer] = function pointer(
- val
+ val,
) {
if (typeof val === "number") return val;
if (!val) {
@@ -222,7 +222,7 @@ ffiWrappers[FFIType.cstring] = ffiWrappers[FFIType.pointer] = function pointer(
if (typeof val === "string") {
throw new TypeError(
- "To convert a string to a pointer, encode it as a buffer"
+ "To convert a string to a pointer, encode it as a buffer",
);
}
@@ -267,7 +267,7 @@ function FFIBuilder(params, returnType, functionToCall, name) {
throw new TypeError(
`Unsupported type ${params[i]}. Must be one of: ${Object.keys(FFIType)
.sort()
- .join(", ")}`
+ .join(", ")}`,
);
}
}
@@ -335,7 +335,7 @@ function FFIBuilder(params, returnType, functionToCall, name) {
arg6,
arg7,
arg8,
- arg9
+ arg9,
);
break;
default: {
@@ -376,7 +376,7 @@ export function dlopen(path, options) {
// "sqlite3_get_version() - sqlit3.so"
path.includes("/")
? `${key} (${path.split("/").pop()})`
- : `${key} (${path})`
+ : `${key} (${path})`,
);
} else {
// consistentcy
@@ -400,7 +400,7 @@ export function linkSymbols(options) {
options[key].args ?? [],
options[key].returns ?? FFIType.void,
symbol,
- key
+ key,
);
} else {
// consistentcy
@@ -433,7 +433,7 @@ export function CFunction(options) {
cFunctionRegistry ||= new FinalizationRegistry(onCloseCFunction);
cFunctionRegistry.register(
result.symbols[identifier],
- result.symbols[identifier].close
+ result.symbols[identifier].close,
);
return result.symbols[identifier];
diff --git a/src/bun.js/fs.exports.js b/src/bun.js/fs.exports.js
index ebf929cb1..583ede0cb 100644
--- a/src/bun.js/fs.exports.js
+++ b/src/bun.js/fs.exports.js
@@ -199,13 +199,13 @@ export var rmSync = fs.rmSync.bind(fs);
// _maxListener
var _lazyReadStream;
var readStreamPathFastPathSymbol = Symbol.for(
- "Bun.Node.readStreamPathFastPath"
+ "Bun.Node.readStreamPathFastPath",
);
const readStreamSymbol = Symbol.for("Bun.NodeReadStream");
const readStreamPathOrFdSymbol = Symbol.for("Bun.NodeReadStreamPathOrFd");
var writeStreamPathFastPathSymbol = Symbol.for("Bun.NodeWriteStreamFastPath");
var writeStreamPathFastPathCallSymbol = Symbol.for(
- "Bun.NodeWriteStreamFastPathCall"
+ "Bun.NodeWriteStreamFastPathCall",
);
var kIoDone = Symbol.for("kIoDone");
@@ -653,7 +653,7 @@ function getLazyWriteStream() {
readStream[kIoDone] = false;
return Bun.write(
this[writeStreamPathFastPathSymbol],
- readStream[readStreamPathOrFdSymbol]
+ readStream[readStreamPathOrFdSymbol],
).then(
(bytesWritten) => {
readStream[kIoDone] = this[kIoDone] = true;
@@ -666,7 +666,7 @@ function getLazyWriteStream() {
readStream[kIoDone] = this[kIoDone] = true;
this.#errorOrDestroy(err);
readStream.emit("error", err);
- }
+ },
);
}
@@ -769,7 +769,7 @@ function getLazyWriteStream() {
this.emit(kIoDone);
!err ? cb() : cb(err);
- }
+ },
);
} else {
this[kIoDone] = true;
@@ -784,7 +784,7 @@ function getLazyWriteStream() {
this.#handleWrite(err, bytes);
this.emit(kIoDone);
!err ? cb() : cb(err);
- }
+ },
);
}
}
diff --git a/src/bun.js/http.exports.js b/src/bun.js/http.exports.js
index 4804b9322..d0a669d7b 100644
--- a/src/bun.js/http.exports.js
+++ b/src/bun.js/http.exports.js
@@ -85,7 +85,7 @@ export class Server extends EventEmitter {
} catch (err) {
this.emit(
"error",
- new Error(`bun-http-polyfill: Bun.serve failed: ${err.message}`)
+ new Error(`bun-http-polyfill: Bun.serve failed: ${err.message}`),
);
}
}
@@ -170,7 +170,7 @@ export class IncomingMessage extends Readable {
this.complete = true;
} else {
this.push(
- this._body.subarray(this._body_offset, (this._body_offset += size))
+ this._body.subarray(this._body_offset, (this._body_offset += size)),
);
}
}
@@ -313,8 +313,8 @@ export class ServerResponse extends Writable {
headers: this.#headers,
status: this.statusCode,
statusText: this.statusMessage ?? STATUS_CODES[this.statusCode],
- }
- )
+ },
+ ),
);
}
@@ -327,7 +327,7 @@ export class ServerResponse extends Writable {
headers: this.#headers,
status: this.statusCode,
statusText: this.statusMessage ?? STATUS_CODES[this.statusCode],
- })
+ }),
);
callback && callback();
return;
diff --git a/src/bun.js/net.exports.js b/src/bun.js/net.exports.js
index ce70c3ee1..fee0c9afa 100644
--- a/src/bun.js/net.exports.js
+++ b/src/bun.js/net.exports.js
@@ -36,7 +36,7 @@ const IPv6Reg = new RegExp(
`(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` +
`(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` +
`(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` +
- ")(%[0-9a-zA-Z-.:]{1,})?$"
+ ")(%[0-9a-zA-Z-.:]{1,})?$",
);
export function isIPv4(s) {
diff --git a/src/bun.js/perf_hooks.exports.js b/src/bun.js/perf_hooks.exports.js
index b49e2fc4a..d25f90ccf 100644
--- a/src/bun.js/perf_hooks.exports.js
+++ b/src/bun.js/perf_hooks.exports.js
@@ -14,7 +14,7 @@ export class PerformanceEntry {
export class PerformanceNodeTiming {
constructor() {
throw new Error(
- "PerformanceNodeTiming is not supported in this environment."
+ "PerformanceNodeTiming is not supported in this environment.",
);
}
}
diff --git a/src/bun.js/scripts/class-definitions.ts b/src/bun.js/scripts/class-definitions.ts
index 95dfd69bf..5dac5db9c 100644
--- a/src/bun.js/scripts/class-definitions.ts
+++ b/src/bun.js/scripts/class-definitions.ts
@@ -6,7 +6,7 @@ export type Field =
fn: string;
length?: number;
DOMJIT?: {
- return: string;
+ returns: string;
args?: [string, string] | [string, string, string] | [string];
};
}
@@ -24,6 +24,7 @@ export interface ClassDefinition {
noConstructor?: boolean;
estimatedSize?: boolean;
hasPendingActivity?: boolean;
+ isEventEmitter?: boolean;
}
export function define(
@@ -35,7 +36,7 @@ export function define(
call = false,
construct = false,
...rest
- } = {} as ClassDefinition
+ } = {} as ClassDefinition,
): ClassDefinition {
return {
...rest,
@@ -44,10 +45,10 @@ export function define(
estimatedSize,
values,
klass: Object.fromEntries(
- Object.entries(klass).sort(([a], [b]) => a.localeCompare(b))
+ Object.entries(klass).sort(([a], [b]) => a.localeCompare(b)),
),
proto: Object.fromEntries(
- Object.entries(proto).sort(([a], [b]) => a.localeCompare(b))
+ Object.entries(proto).sort(([a], [b]) => a.localeCompare(b)),
),
};
}
diff --git a/src/bun.js/scripts/generate-classes.ts b/src/bun.js/scripts/generate-classes.ts
index 2b50246d4..ba6f68e08 100644
--- a/src/bun.js/scripts/generate-classes.ts
+++ b/src/bun.js/scripts/generate-classes.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
import { unlinkSync } from "fs";
import { readdirSync } from "fs";
import { resolve } from "path";
@@ -95,18 +96,18 @@ function DOMJITFunctionDeclaration(jsClassName, fnName, { args, returns }) {
const argNames = args.map((arg, i) => `${argTypeName(arg)} arg${i}`);
return `
extern "C" JSC_DECLARE_JIT_OPERATION_WITHOUT_WTF_INTERNAL(${DOMJITName(
- fnName
+ fnName,
)}Wrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, ${argNames.join(
- ", "
+ ", ",
)}));
extern "C" EncodedJSValue ${DOMJITName(
- fnName
+ fnName,
)}(void* ptr, JSC::JSGlobalObject * lexicalGlobalObject, ${argNames.join(
- ", "
+ ", ",
)});
static const JSC::DOMJIT::Signature DOMJITSignatureFor${fnName}(${DOMJITName(
- fnName
+ fnName,
)}Wrapper,
${jsClassName}::info(),
JSC::DOMJIT::Effect::forReadWrite(JSC::DOMJIT::HeapRange::top(), JSC::DOMJIT::HeapRange::top()),
@@ -120,9 +121,9 @@ function DOMJITFunctionDefinition(jsClassName, fnName, { args }) {
const argNames = args.map((arg, i) => `${argTypeName(arg)} arg${i}`);
return `
JSC_DEFINE_JIT_OPERATION(${DOMJITName(
- fnName
+ fnName,
)}Wrapper, EncodedJSValue, (JSC::JSGlobalObject * lexicalGlobalObject, void* thisValue, ${argNames.join(
- ", "
+ ", ",
)}))
{
VM& vm = JSC::getVM(lexicalGlobalObject);
@@ -131,7 +132,7 @@ JSC_DEFINE_JIT_OPERATION(${DOMJITName(
IGNORE_WARNINGS_END
JSC::JITOperationPrologueCallFrameTracer tracer(vm, callFrame);
return ${DOMJITName(
- fnName
+ fnName,
)}(reinterpret_cast<${jsClassName}*>(thisValue)->wrapped(), lexicalGlobalObject, ${args
.map((b, i) => "arg" + i)
.join(", ")});
@@ -142,7 +143,7 @@ JSC_DEFINE_JIT_OPERATION(${DOMJITName(
function appendSymbols(
to: Map<string, string>,
symbolName: (name: string) => string,
- prop
+ prop,
) {
var { defaultValue, getter, setter, accesosr, fn, DOMJIT, cache } = prop;
@@ -171,7 +172,7 @@ function propRow(
typeName: string,
name: string,
prop: Field,
- isWrapped = true
+ isWrapped = true,
) {
var {
defaultValue,
@@ -183,7 +184,7 @@ function propRow(
length = 0,
cache,
DOMJIT,
- } = prop;
+ } = prop as any;
if (accesosr) {
getter = accesosr.getter;
@@ -249,7 +250,7 @@ export function generateHashTable(
typeName,
obj,
props = {},
- wrapped
+ wrapped,
) {
const rows = [];
@@ -294,7 +295,7 @@ ${
obj.construct
? `extern "C" void* ${classSymbolName(
typeName,
- "construct"
+ "construct",
)}(JSC::JSGlobalObject*, JSC::CallFrame*);
JSC_DECLARE_CUSTOM_GETTER(js${typeName}Constructor);`
: ""
@@ -308,7 +309,7 @@ ${
obj.call
? `extern "C" JSC_DECLARE_HOST_FUNCTION(${classSymbolName(
typeName,
- "call"
+ "call",
)});`
: ""
}
@@ -323,7 +324,7 @@ ${generateHashTable(
obj,
protoFields,
- true
+ true,
)}
@@ -334,14 +335,14 @@ ${renderFieldsImpl(
typeName,
obj,
protoFields,
- obj.values || []
+ obj.values || [],
)}
void ${proto}::finishCreation(JSC::VM& vm, JSC::JSGlobalObject* globalObject)
{
Base::finishCreation(vm);
reifyStaticProperties(vm, ${className(
- typeName
+ typeName,
)}::info(), ${proto}TableValues, *this);
JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
}
@@ -391,7 +392,7 @@ function generateConstructorHeader(typeName) {
public:
using Base = JSC::InternalFunction;
static ${name}* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, ${prototypeName(
- typeName
+ typeName,
)}* prototype);
static constexpr unsigned StructureFlags = Base::StructureFlags;
@@ -409,22 +410,22 @@ function generateConstructorHeader(typeName) {
return WebCore::subspaceForImpl<${name}, WebCore::UseCustomHeapCellType::No>(
vm,
[](auto& spaces) { return spaces.${clientSubspaceFor(
- typeName
+ typeName,
)}Constructor.get(); },
[](auto& spaces, auto&& space) { spaces.${clientSubspaceFor(
- typeName
+ typeName,
)}Constructor = WTFMove(space); },
[](auto& spaces) { return spaces.${subspaceFor(
- typeName
+ typeName,
)}Constructor.get(); },
[](auto& spaces, auto&& space) { spaces.${subspaceFor(
- typeName
+ typeName,
)}Constructor = WTFMove(space); });
}
void initializeProperties(JSC::VM& vm, JSC::JSGlobalObject* globalObject, ${prototypeName(
- typeName
+ typeName,
)}* prototype);
// Must be defined for each specialization class.
@@ -434,7 +435,7 @@ function generateConstructorHeader(typeName) {
private:
${name}(JSC::VM& vm, JSC::Structure* structure);
void finishCreation(JSC::VM&, JSC::JSGlobalObject* globalObject, ${prototypeName(
- typeName
+ typeName,
)}* prototype);
};
@@ -460,7 +461,7 @@ ${renderStaticDecls(classSymbolName, typeName, fields)}
${hashTable}
void ${name}::finishCreation(VM& vm, JSC::JSGlobalObject* globalObject, ${prototypeName(
- typeName
+ typeName,
)}* prototype)
{
Base::finishCreation(vm, 0, "${typeName}"_s, PropertyAdditionMode::WithoutStructureTransition);
@@ -480,7 +481,7 @@ ${name}::${name}(JSC::VM& vm, JSC::Structure* structure) : Base(vm, structure, $
}
${name}* ${name}::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, ${prototypeName(
- typeName
+ typeName,
)}* prototype) {
${name}* ptr = new (NotNull, JSC::allocateCell<${name}>(vm)) ${name}(vm, structure);
ptr->finishCreation(vm, globalObject, prototype);
@@ -511,7 +512,7 @@ JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES ${name}::construct(JSC::JSGlobalObj
void* ptr = ${classSymbolName(
typeName,
- "construct"
+ "construct",
)}(globalObject, callFrame);
if (UNLIKELY(!ptr)) {
@@ -519,13 +520,13 @@ JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES ${name}::construct(JSC::JSGlobalObj
}
${className(typeName)}* instance = ${className(
- typeName
+ typeName,
)}::create(vm, globalObject, structure, ptr);
${
obj.estimatedSize
? `vm.heap.reportExtraMemoryAllocated(${symbolName(
obj.name,
- "estimatedSize"
+ "estimatedSize",
)}(instance->wrapped()));`
: ""
}
@@ -537,13 +538,13 @@ extern "C" EncodedJSValue ${typeName}__create(Zig::GlobalObject* globalObject, v
auto &vm = globalObject->vm();
JSC::Structure* structure = globalObject->${className(typeName)}Structure();
${className(typeName)}* instance = ${className(
- typeName
+ typeName,
)}::create(vm, globalObject, structure, ptr);
${
obj.estimatedSize
? `vm.heap.reportExtraMemoryAllocated(${symbolName(
obj.name,
- "estimatedSize"
+ "estimatedSize",
)}(ptr));`
: ""
}
@@ -551,7 +552,7 @@ extern "C" EncodedJSValue ${typeName}__create(Zig::GlobalObject* globalObject, v
}
void ${name}::initializeProperties(VM& vm, JSC::JSGlobalObject* globalObject, ${prototypeName(
- typeName
+ typeName,
)}* prototype)
{
@@ -607,12 +608,12 @@ function renderDecls(symbolName, typeName, proto) {
rows.push(
`extern "C" JSC::EncodedJSValue ${symbolName(
typeName,
- proto[name].getter || proto[name].accessor.getter
+ proto[name].getter || proto[name].accessor.getter,
)}(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject);`,
`
JSC_DECLARE_CUSTOM_GETTER(${symbolName(typeName, name)}GetterWrap);
`.trim(),
- "\n"
+ "\n",
);
}
@@ -623,12 +624,12 @@ function renderDecls(symbolName, typeName, proto) {
rows.push(
`extern "C" bool ${symbolName(
typeName,
- proto[name].setter || proto[name].accessor.setter
+ proto[name].setter || proto[name].accessor.setter,
)}(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::EncodedJSValue value);`,
`
JSC_DECLARE_CUSTOM_SETTER(${symbolName(typeName, name)}SetterWrap);
`.trim(),
- "\n"
+ "\n",
);
}
@@ -636,13 +637,13 @@ function renderDecls(symbolName, typeName, proto) {
rows.push(
`extern "C" EncodedJSValue ${symbolName(
typeName,
- proto[name].fn
+ proto[name].fn,
)}(void* ptr, JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame);`,
`
JSC_DECLARE_HOST_FUNCTION(${symbolName(typeName, name)}Callback);
`.trim(),
- "\n"
+ "\n",
);
if (proto[name].DOMJIT) {
@@ -650,13 +651,13 @@ function renderDecls(symbolName, typeName, proto) {
DOMJITFunctionDeclaration(
className(typeName),
symbolName(typeName, name),
- proto[name].DOMJIT
+ proto[name].DOMJIT,
),
DOMJITFunctionDefinition(
className(typeName),
symbolName(typeName, name),
- proto[name].DOMJIT
- )
+ proto[name].DOMJIT,
+ ),
);
}
}
@@ -676,8 +677,8 @@ function renderStaticDecls(symbolName, typeName, fields) {
rows.push(
`extern "C" JSC_DECLARE_CUSTOM_GETTER(${symbolName(
typeName,
- fields[name].getter || fields[name].accessor.getter
- )});`
+ fields[name].getter || fields[name].accessor.getter,
+ )});`,
);
}
@@ -688,8 +689,8 @@ function renderStaticDecls(symbolName, typeName, fields) {
rows.push(
`extern "C" JSC_DECLARE_CUSTOM_SETTER(${symbolName(
typeName,
- fields[name].setter || fields[name].accessor.setter
- )});`
+ fields[name].setter || fields[name].accessor.setter,
+ )});`,
);
}
@@ -697,8 +698,8 @@ function renderStaticDecls(symbolName, typeName, fields) {
rows.push(
`extern "C" JSC_DECLARE_HOST_FUNCTION(${symbolName(
typeName,
- fields[name].fn
- )});`
+ fields[name].fn,
+ )});`,
);
}
}
@@ -710,23 +711,23 @@ function writeBarrier(symbolName, typeName, name, cacheName) {
extern "C" void ${symbolName(
typeName,
- name
+ name,
)}SetCachedValue(JSC::EncodedJSValue thisValue, JSC::JSGlobalObject *globalObject, JSC::EncodedJSValue value)
{
auto& vm = globalObject->vm();
auto* thisObject = jsCast<${className(
- typeName
+ typeName,
)}*>(JSValue::decode(thisValue));
thisObject->${cacheName}.set(vm, thisObject, JSValue::decode(value));
}
extern "C" EncodedJSValue ${symbolName(
typeName,
- name
+ name,
)}GetCachedValue(JSC::EncodedJSValue thisValue)
{
auto* thisObject = jsCast<${className(
- typeName
+ typeName,
)}*>(JSValue::decode(thisValue));
return JSValue::encode(thisObject->${cacheName}.get());
}
@@ -738,7 +739,7 @@ function renderFieldsImpl(
typeName: string,
obj: ClassDefinition,
proto: ClassDefinition["proto"],
- cachedValues: string[]
+ cachedValues: string[],
) {
const rows: string[] = [];
@@ -751,7 +752,7 @@ JSC_DEFINE_CUSTOM_GETTER(js${typeName}Constructor, (JSGlobalObject * lexicalGlob
auto throwScope = DECLARE_THROW_SCOPE(vm);
auto* globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
auto* prototype = jsDynamicCast<${prototypeName(
- typeName
+ typeName,
)}*>(JSValue::decode(thisValue));
if (UNLIKELY(!prototype))
@@ -772,14 +773,14 @@ JSC_DEFINE_CUSTOM_GETTER(js${typeName}Constructor, (JSGlobalObject * lexicalGlob
rows.push(`
JSC_DEFINE_CUSTOM_GETTER(${symbolName(
typeName,
- name
+ name,
)}GetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
{
auto& vm = lexicalGlobalObject->vm();
Zig::GlobalObject *globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
auto throwScope = DECLARE_THROW_SCOPE(vm);
${className(typeName)}* thisObject = jsCast<${className(
- typeName
+ typeName,
)}*>(JSValue::decode(thisValue));
JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
@@ -789,7 +790,7 @@ JSC_DEFINE_CUSTOM_GETTER(${symbolName(
JSC::JSValue result = JSC::JSValue::decode(
${symbolName(
typeName,
- proto[name].getter
+ proto[name].getter,
)}(thisObject->wrapped(), globalObject)
);
RETURN_IF_EXCEPTION(throwScope, {});
@@ -805,19 +806,19 @@ JSC_DEFINE_CUSTOM_GETTER(${symbolName(
rows.push(`
JSC_DEFINE_CUSTOM_GETTER(${symbolName(
typeName,
- name
+ name,
)}GetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName))
{
auto& vm = lexicalGlobalObject->vm();
Zig::GlobalObject *globalObject = reinterpret_cast<Zig::GlobalObject*>(lexicalGlobalObject);
auto throwScope = DECLARE_THROW_SCOPE(vm);
${className(typeName)}* thisObject = jsCast<${className(
- typeName
+ typeName,
)}*>(JSValue::decode(thisValue));
JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
JSC::EncodedJSValue result = ${symbolName(
typeName,
- proto[name].getter
+ proto[name].getter,
)}(thisObject->wrapped(), globalObject);
RETURN_IF_EXCEPTION(throwScope, {});
RELEASE_AND_RETURN(throwScope, result);
@@ -833,23 +834,23 @@ JSC_DEFINE_CUSTOM_GETTER(${symbolName(
`
JSC_DEFINE_CUSTOM_SETTER(${symbolName(
typeName,
- name
+ name,
)}SetterWrap, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName))
{
auto& vm = lexicalGlobalObject->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
${className(typeName)}* thisObject = jsCast<${className(
- typeName
+ typeName,
)}*>(JSValue::decode(thisValue));
JSC::EnsureStillAliveScope thisArg = JSC::EnsureStillAliveScope(thisObject);
auto result = ${symbolName(
typeName,
- proto[name].setter || proto[name].accessor.setter
+ proto[name].setter || proto[name].accessor.setter,
)}(thisObject->wrapped(), lexicalGlobalObject, encodedValue);
RELEASE_AND_RETURN(throwScope, result);
}
-`
+`,
);
}
@@ -857,13 +858,13 @@ JSC_DEFINE_CUSTOM_SETTER(${symbolName(
rows.push(`
JSC_DEFINE_HOST_FUNCTION(${symbolName(
typeName,
- name
+ name,
)}Callback, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame))
{
auto& vm = lexicalGlobalObject->vm();
${className(typeName)}* thisObject = jsDynamicCast<${className(
- typeName
+ typeName,
)}*>(callFrame->thisValue());
if (UNLIKELY(!thisObject)) {
@@ -875,7 +876,7 @@ JSC_DEFINE_CUSTOM_SETTER(${symbolName(
return ${symbolName(
typeName,
- proto[name].fn
+ proto[name].fn,
)}(thisObject->wrapped(), lexicalGlobalObject, callFrame);
}
`);
@@ -885,7 +886,7 @@ JSC_DEFINE_CUSTOM_SETTER(${symbolName(
if (cachedValues?.length) {
for (const cacheName of cachedValues) {
rows.push(
- writeBarrier(symbolName, typeName, cacheName, "m_" + cacheName)
+ writeBarrier(symbolName, typeName, cacheName, "m_" + cacheName),
);
}
}
@@ -955,16 +956,16 @@ function generateClassHeader(typeName, obj: ClassDefinition) {
return WebCore::subspaceForImpl<${name}, WebCore::UseCustomHeapCellType::No>(
vm,
[](auto& spaces) { return spaces.${clientSubspaceFor(
- typeName
+ typeName,
)}.get(); },
[](auto& spaces, auto&& space) { spaces.${clientSubspaceFor(
- typeName
+ typeName,
)} = WTFMove(space); },
[](auto& spaces) { return spaces.${subspaceFor(
- typeName
+ typeName,
)}.get(); },
[](auto& spaces, auto&& space) { spaces.${subspaceFor(
- typeName
+ typeName,
)} = WTFMove(space); });
}
@@ -1027,7 +1028,7 @@ function generateClassImpl(typeName, obj: ClassDefinition) {
]
.filter(
([name, { cache = false, internal = false }]) =>
- (cache || internal) === true
+ (cache || internal) === true,
)
.map(([name]) => ` visitor.append(thisObject->m_${name});`)
.join("\n");
@@ -1119,7 +1120,7 @@ extern "C" void* ${typeName}__fromJS(JSC::EncodedJSValue value) {
return nullptr;
${className(typeName)}* object = JSC::jsDynamicCast<${className(
- typeName
+ typeName,
)}*>(decodedValue);
if (!object)
@@ -1130,7 +1131,7 @@ extern "C" void* ${typeName}__fromJS(JSC::EncodedJSValue value) {
extern "C" bool ${typeName}__dangerouslySetPtr(JSC::EncodedJSValue value, void* ptr) {
${className(typeName)}* object = JSC::jsDynamicCast<${className(
- typeName
+ typeName,
)}*>(JSValue::decode(value));
if (!object)
return false;
@@ -1141,7 +1142,7 @@ extern "C" bool ${typeName}__dangerouslySetPtr(JSC::EncodedJSValue value, void*
extern "C" const size_t ${typeName}__ptrOffset = ${className(
- typeName
+ typeName,
)}::offsetOfWrapped();
void ${name}::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer)
@@ -1157,18 +1158,18 @@ void ${name}::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer)
JSObject* ${name}::createConstructor(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
return WebCore::${constructorName(
- typeName
+ typeName,
)}::create(vm, globalObject, WebCore::${constructorName(
- typeName
+ typeName,
)}::createStructure(vm, globalObject, globalObject->functionPrototype()), jsCast<WebCore::${prototypeName(
- typeName
+ typeName,
)}*>(prototype));
}
JSObject* ${name}::createPrototype(VM& vm, JSDOMGlobalObject* globalObject)
{
return ${prototypeName(typeName)}::create(vm, globalObject, ${prototypeName(
- typeName
+ typeName,
)}::createStructure(vm, globalObject, globalObject->objectPrototype()));
}
@@ -1207,7 +1208,7 @@ function generateZig(
call = false,
values = [],
hasPendingActivity = false,
- } = {} as ClassDefinition
+ } = {} as ClassDefinition,
) {
const exports = new Map<string, string>();
@@ -1230,15 +1231,15 @@ function generateZig(
if (hasPendingActivity) {
exports.set(
"hasPendingActivity",
- symbolName(typeName, "hasPendingActivity")
+ symbolName(typeName, "hasPendingActivity"),
);
}
Object.values(klass).map((a) =>
- appendSymbols(exports, (name) => classSymbolName(typeName, name), a)
+ appendSymbols(exports, (name) => classSymbolName(typeName, name), a),
);
Object.values(proto).map((a) =>
- appendSymbols(exports, (name) => protoSymbolName(typeName, name), a)
+ appendSymbols(exports, (name) => protoSymbolName(typeName, name), a),
);
const externs = Object.entries({
@@ -1247,18 +1248,18 @@ function generateZig(
})
.filter(
([name, { cache, internal }]) =>
- (cache && typeof cache !== "string") || internal
+ (cache && typeof cache !== "string") || internal,
)
.map(
([name]) =>
`extern fn ${protoSymbolName(
typeName,
- name
+ name,
)}SetCachedValue(JSC.JSValue, *JSC.JSGlobalObject, JSC.JSValue) void;
extern fn ${protoSymbolName(
typeName,
- name
+ name,
)}GetCachedValue(JSC.JSValue) JSC.JSValue;
/// \`${typeName}.${name}\` setter
@@ -1267,7 +1268,7 @@ function generateZig(
JSC.markBinding(@src());
${protoSymbolName(
typeName,
- name
+ name,
)}SetCachedValue(thisValue, globalObject, value);
}
@@ -1277,14 +1278,14 @@ function generateZig(
JSC.markBinding(@src());
const result = ${protoSymbolName(
typeName,
- name
+ name,
)}GetCachedValue(thisValue);
if (result == .zero)
return null;
return result;
}
-`.trim() + "\n"
+`.trim() + "\n",
)
.join("\n");
@@ -1344,7 +1345,7 @@ function generateZig(
output += `
if (@TypeOf(${typeName}.${DOMJITName(fn)}) != ${ZigDOMJITFunctionType(
typeName,
- DOMJIT
+ DOMJIT,
)})
@compileLog(
"Expected ${typeName}.${DOMJITName(fn)} to be a DOMJIT function"
@@ -1357,7 +1358,7 @@ function generateZig(
"Expected ${typeName}.${fn} to be a callback"
);`;
}
- }
+ },
);
[...Object.values(klass)].forEach(({ getter, setter, accessor, fn }) => {
@@ -1438,7 +1439,7 @@ pub const ${className(typeName)} = struct {
if (comptime Environment.allow_assert) {
const value__ = ${symbolName(
typeName,
- "create"
+ "create",
)}(globalObject, this);
std.debug.assert(value__.as(${typeName}).? == this); // If this fails, likely a C ABI issue.
return value__;
@@ -1458,19 +1459,19 @@ pub const ${className(typeName)} = struct {
JSC.markBinding(@src());
std.debug.assert(${symbolName(
typeName,
- "dangerouslySetPtr"
+ "dangerouslySetPtr",
)}(value, null));
}
extern fn ${symbolName(typeName, "fromJS")}(JSC.JSValue) ?*${typeName};
extern fn ${symbolName(
typeName,
- "getConstructor"
+ "getConstructor",
)}(*JSC.JSGlobalObject) JSC.JSValue;
extern fn ${symbolName(
typeName,
- "create"
+ "create",
)}(globalObject: *JSC.JSGlobalObject, ptr: ?*${typeName}) JSC.JSValue;
extern fn ${typeName}__dangerouslySetPtr(JSC.JSValue, ?*${typeName}) bool;
@@ -1482,7 +1483,7 @@ ${[...exports]
.sort(([a], [b]) => a.localeCompare(b))
.map(
([internalName, externalName]) =>
- `@export(${typeName}.${internalName}, .{.name = "${externalName}"});`
+ `@export(${typeName}.${internalName}, .{.name = "${externalName}"});`,
)
.join("\n ")}
}
@@ -1495,21 +1496,21 @@ ${[...exports]
function generateLazyClassStructureHeader(
typeName,
- { klass = {}, proto = {} }
+ { klass = {}, proto = {} },
) {
return `
JSC::Structure* ${className(
- typeName
+ typeName,
)}Structure() { return m_${className(
- typeName
+ typeName,
)}.getInitializedOnMainThread(this); }
JSC::JSObject* ${className(
- typeName
+ typeName,
)}Constructor() { return m_${className(
- typeName
+ typeName,
)}.constructorInitializedOnMainThread(this); }
JSC::JSValue ${className(typeName)}Prototype() { return m_${className(
- typeName
+ typeName,
)}.prototypeInitializedOnMainThread(this); }
JSC::LazyClassStructure m_${className(typeName)};
bool has${className(typeName)}SetterValue { false };
@@ -1520,7 +1521,7 @@ function generateLazyClassStructureHeader(
function generateLazyStructureHeader(typeName, { klass = {}, proto = {} }) {
return `
JSC::Structure* ${className(
- typeName
+ typeName,
)}Structure() { return m_${className(typeName)}.get(this); }
JSC::LazyProperty<Zig::GlobalObject, Structure> m_${className(typeName)};
bool has${className(typeName)}SetterValue { false };
@@ -1533,10 +1534,10 @@ function generateLazyStructureImpl(typeName, { klass = {}, proto = {} }) {
m_${className(typeName)}.initLater(
[](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::JSObject>::Initializer& init) {
auto *prototype = WebCore::${className(
- typeName
+ typeName,
)}::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.owner));
init.set(WebCore::${className(
- typeName
+ typeName,
)}::createStructure(init.vm, init.owner, prototype));
});
@@ -1548,13 +1549,13 @@ function generateLazyClassStructureImpl(typeName, { klass = {}, proto = {} }) {
m_${className(typeName)}.initLater(
[](LazyClassStructure::Initializer& init) {
init.setPrototype(WebCore::${className(
- typeName
+ typeName,
)}::createPrototype(init.vm, reinterpret_cast<Zig::GlobalObject*>(init.global)));
init.setStructure(WebCore::${className(
- typeName
+ typeName,
)}::createStructure(init.vm, init.global, init.prototype));
init.setConstructor(WebCore::${className(
- typeName
+ typeName,
)}::createConstructor(init.vm, init.global, init.prototype));
});
@@ -1645,10 +1646,10 @@ void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor&
.map(
(a) =>
`thisObject->m_${className(
- a.name
+ a.name,
)}.visit(visitor); visitor.append(thisObject->m_${className(
- a.name
- )}SetterValue);`
+ a.name,
+ )}SetterValue);`,
)
.join("\n ")}
}
@@ -1725,9 +1726,9 @@ await writeAndUnlink(
.map((a) =>
!a.noConstructor
? generateLazyClassStructureHeader(a.name, a)
- : generateLazyStructureHeader(a.name, a)
+ : generateLazyStructureHeader(a.name, a),
)
- .join("\n")
+ .join("\n"),
);
await writeAndUnlink(
@@ -1737,11 +1738,11 @@ await writeAndUnlink(
`std::unique_ptr<GCClient::IsoSubspace> ${clientSubspaceFor(a.name)};`,
!a.noConstructor
? `std::unique_ptr<GCClient::IsoSubspace> ${clientSubspaceFor(
- a.name
+ a.name,
)}Constructor;`
: "",
- ].join("\n")
- )
+ ].join("\n"),
+ ),
);
await writeAndUnlink(
@@ -1752,8 +1753,8 @@ await writeAndUnlink(
!a.noConstructor
? `std::unique_ptr<IsoSubspace> ${subspaceFor(a.name)}Constructor;`
: ``,
- ].join("\n")
- )
+ ].join("\n"),
+ ),
);
await writeAndUnlink(
@@ -1762,11 +1763,11 @@ await writeAndUnlink(
classes.map((a) =>
!a.noConstructor
? generateLazyClassStructureImpl(a.name, a)
- : generateLazyStructureImpl(a.name, a)
- )
+ : generateLazyStructureImpl(a.name, a),
+ ),
) +
"\n" +
- visitLazyClasses(classes)
+ visitLazyClasses(classes),
);
export {};
diff --git a/src/bun.js/scripts/generate-jssink.js b/src/bun.js/scripts/generate-jssink.js
index 65fc864fb..0e9d3bb50 100644
--- a/src/bun.js/scripts/generate-jssink.js
+++ b/src/bun.js/scripts/generate-jssink.js
@@ -481,19 +481,19 @@ JSC_DEFINE_HOST_FUNCTION(${name}__doClose, (JSC::JSGlobalObject * lexicalGlobalO
/* Source for JS${name}PrototypeTableValues.lut.h
@begin JS${name}PrototypeTable
close ${`${name}__doClose`.padEnd(
- padding + 8
+ padding + 8,
)} ReadOnly|DontDelete|Function 0
flush ${`${name}__flush`.padEnd(
- padding + 8
+ padding + 8,
)} ReadOnly|DontDelete|Function 1
end ${`${name}__end`.padEnd(
- padding + 8
+ padding + 8,
)} ReadOnly|DontDelete|Function 0
start ${`${name}__start`.padEnd(
- padding + 8
+ padding + 8,
)} ReadOnly|DontDelete|Function 1
write ${`${name}__write`.padEnd(
- padding + 8
+ padding + 8,
)} ReadOnly|DontDelete|Function 1
@end
*/
@@ -502,19 +502,19 @@ JSC_DEFINE_HOST_FUNCTION(${name}__doClose, (JSC::JSGlobalObject * lexicalGlobalO
/* Source for ${controllerPrototypeName}TableValues.lut.h
@begin ${controllerPrototypeName}Table
close ${`${controller}__close`.padEnd(
- protopad + 4
+ protopad + 4,
)} ReadOnly|DontDelete|Function 0
flush ${`${name}__flush`.padEnd(
- protopad + 4
+ protopad + 4,
)} ReadOnly|DontDelete|Function 1
end ${`${controller}__end`.padEnd(
- protopad + 4
+ protopad + 4,
)} ReadOnly|DontDelete|Function 0
start ${`${name}__start`.padEnd(
- protopad + 4
+ protopad + 4,
)} ReadOnly|DontDelete|Function 1
write ${`${name}__write`.padEnd(
- protopad + 4
+ protopad + 4,
)} ReadOnly|DontDelete|Function 1
@end
*/
@@ -950,5 +950,5 @@ extern "C" void ${name}__onClose(JSC__JSValue controllerValue, JSC__JSValue reas
await Bun.write(resolve(import.meta.dir + "/../bindings/JSSink.h"), header());
await Bun.write(
resolve(import.meta.dir + "/../bindings/JSSink.cpp"),
- await implementation()
+ await implementation(),
);
diff --git a/src/bun.js/streams.exports.js b/src/bun.js/streams.exports.js
index a7a37b107..24e34447d 100644
--- a/src/bun.js/streams.exports.js
+++ b/src/bun.js/streams.exports.js
@@ -94,13 +94,13 @@ var ArrayIsArray = Array.isArray;
function ERR_INVALID_ARG_TYPE(name, type, value) {
return new Error(
- `The argument '${name}' is invalid. Received '${value}' for type '${type}'`
+ `The argument '${name}' is invalid. Received '${value}' for type '${type}'`,
);
}
function ERR_INVALID_ARG_VALUE(name, value, reason) {
return new Error(
- `The value '${value}' is invalid for argument '${name}'. Reason: ${reason}`
+ `The value '${value}' is invalid for argument '${name}'. Reason: ${reason}`,
);
}
@@ -220,7 +220,7 @@ var require_util = __commonJS({
constructor(errors) {
if (!Array.isArray(errors)) {
throw new TypeError(
- `Expected input to be an Array, got ${typeof errors}`
+ `Expected input to be an Array, got ${typeof errors}`,
);
}
let message = "";
@@ -327,7 +327,7 @@ var require_util = __commonJS({
isBlob,
};
module.exports.promisify.custom = Symbol.for(
- "nodejs.util.promisify.custom"
+ "nodejs.util.promisify.custom",
);
},
});
@@ -375,14 +375,14 @@ var require_errors = __commonJS({
if (typeof msg === "function") {
assert(
msg.length <= args.length,
- `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`
+ `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${msg.length}).`,
);
return msg(...args);
}
const expectedLength = (msg.match(/%[dfijoOs]/g) || []).length;
assert(
expectedLength === args.length,
- `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`
+ `Code: ${key}; The provided arguments length (${args.length}) does not match the required ones (${expectedLength}).`,
);
if (args.length === 0) {
return msg;
@@ -436,7 +436,7 @@ var require_errors = __commonJS({
}
const err = new AggregateError(
[outerError, innerError],
- outerError.message
+ outerError.message,
);
err.code = outerError.code;
return err;
@@ -474,7 +474,7 @@ var require_errors = __commonJS({
for (const value of expected) {
assert(
typeof value === "string",
- "All expected entries have to be of type string"
+ "All expected entries have to be of type string",
);
if (kTypes.includes(value)) {
types.push(value.toLowerCase());
@@ -483,7 +483,7 @@ var require_errors = __commonJS({
} else {
assert(
value !== "object",
- 'The value "object" should be written as "Object"'
+ 'The value "object" should be written as "Object"',
);
other.push(value);
}
@@ -575,7 +575,7 @@ var require_errors = __commonJS({
}
return msg;
},
- TypeError
+ TypeError,
);
E(
"ERR_INVALID_ARG_VALUE",
@@ -587,7 +587,7 @@ var require_errors = __commonJS({
const type = name.includes(".") ? "property" : "argument";
return `The ${type} '${name}' ${reason}. Received ${inspected}`;
},
- TypeError
+ TypeError,
);
E(
"ERR_INVALID_RETURN_VALUE",
@@ -603,7 +603,7 @@ var require_errors = __commonJS({
: `type ${typeof value}`;
return `Expected ${input} to be returned from the "${name}" function but got ${type}.`;
},
- TypeError
+ TypeError,
);
E(
"ERR_MISSING_ARGS",
@@ -630,7 +630,7 @@ var require_errors = __commonJS({
}
return `${msg} must be specified`;
},
- TypeError
+ TypeError,
);
E(
"ERR_OUT_OF_RANGE",
@@ -650,32 +650,32 @@ var require_errors = __commonJS({
}
return `The value of "${str}" is out of range. It must be ${range}. Received ${received}`;
},
- RangeError
+ RangeError,
);
E("ERR_MULTIPLE_CALLBACK", "Callback called multiple times", Error);
E("ERR_METHOD_NOT_IMPLEMENTED", "The %s method is not implemented", Error);
E(
"ERR_STREAM_ALREADY_FINISHED",
"Cannot call %s after a stream was finished",
- Error
+ Error,
);
E("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable", Error);
E(
"ERR_STREAM_DESTROYED",
"Cannot call %s after a stream was destroyed",
- Error
+ Error,
);
E(
"ERR_STREAM_NULL_VALUES",
"May not write null values to stream",
- TypeError
+ TypeError,
);
E("ERR_STREAM_PREMATURE_CLOSE", "Premature close", Error);
E("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF", Error);
E(
"ERR_STREAM_UNSHIFT_AFTER_END_EVENT",
"stream.unshift() after end event",
- Error
+ Error,
);
E("ERR_STREAM_WRITE_AFTER_END", "write after end", Error);
E("ERR_UNKNOWN_ENCODING", "Unknown encoding: %s", TypeError);
@@ -745,7 +745,7 @@ var require_validators = __commonJS({
value,
name,
min = NumberMIN_SAFE_INTEGER,
- max = NumberMAX_SAFE_INTEGER
+ max = NumberMAX_SAFE_INTEGER,
) => {
if (typeof value !== "number")
throw new ERR_INVALID_ARG_TYPE(name, "number", value);
@@ -753,7 +753,7 @@ var require_validators = __commonJS({
throw new ERR_OUT_OF_RANGE(name, "an integer", value);
if (value < min || value > max)
throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);
- }
+ },
);
var validateInt32 = hideStackFrames(
(value, name, min = -2147483648, max = 2147483647) => {
@@ -769,7 +769,7 @@ var require_validators = __commonJS({
if (value < min || value > max) {
throw new ERR_OUT_OF_RANGE(name, `>= ${min} && <= ${max}`, value);
}
- }
+ },
);
var validateUint32 = hideStackFrames((value, name, positive) => {
if (typeof value !== "number") {
@@ -798,9 +798,9 @@ var require_validators = __commonJS({
if (!ArrayPrototypeIncludes(oneOf, value)) {
const allowed = ArrayPrototypeJoin(
ArrayPrototypeMap(oneOf, (v) =>
- typeof v === "string" ? `'${v}'` : String2(v)
+ typeof v === "string" ? `'${v}'` : String2(v),
),
- ", "
+ ", ",
);
const reason = "must be one of: " + allowed;
throw new ERR_INVALID_ARG_VALUE(name, value, reason);
@@ -838,7 +838,7 @@ var require_validators = __commonJS({
if (signals[signal] === void 0) {
if (signals[StringPrototypeToUpperCase(signal)] !== void 0) {
throw new ERR_UNKNOWN_SIGNAL(
- signal + " (signals must use all capital letters)"
+ signal + " (signals must use all capital letters)",
);
}
throw new ERR_UNKNOWN_SIGNAL(signal);
@@ -849,7 +849,7 @@ var require_validators = __commonJS({
throw new ERR_INVALID_ARG_TYPE(
name,
["Buffer", "TypedArray", "DataView"],
- buffer
+ buffer,
);
}
});
@@ -860,7 +860,7 @@ var require_validators = __commonJS({
throw new ERR_INVALID_ARG_VALUE(
"encoding",
encoding,
- `is invalid for data of length ${length}`
+ `is invalid for data of length ${length}`,
);
}
}
@@ -927,7 +927,7 @@ var require_validators = __commonJS({
var require_utils = __commonJS({
"node_modules/readable-stream/lib/internal/streams/utils.js"(
exports,
- module
+ module,
) {
"use strict";
var {
@@ -1304,7 +1304,7 @@ var require_utils = __commonJS({
var require_end_of_stream = __commonJS({
"node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(
exports,
- module
+ module,
) {
"use strict";
var { AbortError, codes } = require_errors();
@@ -1489,7 +1489,7 @@ var require_end_of_stream = __commonJS({
stream,
new AbortError(void 0, {
cause: options.signal.reason,
- })
+ }),
);
};
if (options.signal.aborted) {
@@ -1525,7 +1525,7 @@ var require_end_of_stream = __commonJS({
var require_operators = __commonJS({
"node_modules/readable-stream/lib/internal/streams/operators.js"(
exports,
- module
+ module,
) {
"use strict";
var AbortController =
@@ -1738,7 +1738,7 @@ var require_operators = __commonJS({
async (...args) => {
return !(await fn(...args));
},
- options
+ options,
));
}
async function find(fn, options) {
@@ -1781,7 +1781,7 @@ var require_operators = __commonJS({
throw new ERR_INVALID_ARG_TYPE(
"reducer",
["Function", "AsyncFunction"],
- reducer
+ reducer,
);
}
if (options != null) {
@@ -1997,7 +1997,7 @@ var require_operators = __commonJS({
var require_destroy = __commonJS({
"node_modules/readable-stream/lib/internal/streams/destroy.js"(
exports,
- module
+ module,
) {
"use strict";
var {
@@ -2183,7 +2183,7 @@ var require_destroy = __commonJS({
if (called) {
errorOrDestroy(
stream,
- err !== null && err !== void 0 ? err : new ERR_MULTIPLE_CALLBACK()
+ err !== null && err !== void 0 ? err : new ERR_MULTIPLE_CALLBACK(),
);
return;
}
@@ -2265,7 +2265,7 @@ var require_destroy = __commonJS({
var require_legacy = __commonJS({
"node_modules/readable-stream/lib/internal/streams/legacy.js"(
exports,
- module
+ module,
) {
"use strict";
var { ArrayIsArray, ObjectSetPrototypeOf } = require_primordials();
@@ -2349,7 +2349,7 @@ var require_legacy = __commonJS({
var require_add_abort_signal = __commonJS({
"node_modules/readable-stream/lib/internal/streams/add-abort-signal.js"(
exports,
- module
+ module,
) {
"use strict";
var { AbortError, codes } = require_errors();
@@ -2378,7 +2378,7 @@ var require_add_abort_signal = __commonJS({
stream.destroy(
new AbortError(void 0, {
cause: signal.reason,
- })
+ }),
);
};
if (signal.aborted) {
@@ -2396,7 +2396,7 @@ var require_add_abort_signal = __commonJS({
var require_state = __commonJS({
"node_modules/readable-stream/lib/internal/streams/state.js"(
exports,
- module
+ module,
) {
"use strict";
var { MathFloor, NumberIsInteger } = require_primordials();
@@ -2477,7 +2477,7 @@ var require_from = __commonJS({
PromisePrototypeThen(
close(error),
() => runOnNextTick(cb, error),
- (e) => runOnNextTick(cb, e || error)
+ (e) => runOnNextTick(cb, e || error),
);
};
async function close(error) {
@@ -2531,7 +2531,7 @@ var require_from = __commonJS({
var require_readable = __commonJS({
"node_modules/readable-stream/lib/internal/streams/readable.js"(
exports,
- module
+ module,
) {
"use strict";
var {
@@ -2648,7 +2648,7 @@ var require_readable = __commonJS({
if (!value)
throw new Error(
- `Invalid value from ReadableStream reader: ${value}`
+ `Invalid value from ReadableStream reader: ${value}`,
);
if (ArrayIsArray(value)) {
this.push(...value);
@@ -2698,7 +2698,7 @@ var require_readable = __commonJS({
throw new ERR_INVALID_ARG_TYPE(
"readableStream",
"ReadableStream",
- readableStream
+ readableStream,
);
}
@@ -2783,7 +2783,7 @@ var require_readable = __commonJS({
err = new ERR_INVALID_ARG_TYPE(
"chunk",
["string", "Buffer", "Uint8Array"],
- chunk
+ chunk,
);
}
}
@@ -3043,7 +3043,7 @@ var require_readable = __commonJS({
if (!state.multiAwaitDrain) {
state.multiAwaitDrain = true;
state.awaitDrainWriters = new SafeSet(
- state.awaitDrainWriters ? [state.awaitDrainWriters] : []
+ state.awaitDrainWriters ? [state.awaitDrainWriters] : [],
);
}
}
@@ -3325,7 +3325,7 @@ var require_readable = __commonJS({
error = err ? aggregateTwoErrors(error, err) : null;
callback();
callback = nop;
- }
+ },
);
try {
while (true) {
@@ -3530,12 +3530,12 @@ var require_readable = __commonJS({
Readable.fromWeb = function (readableStream, options) {
return lazyWebStreams().newStreamReadableFromReadableStream(
readableStream,
- options
+ options,
);
};
Readable.toWeb = function (streamReadable) {
return lazyWebStreams().newReadableStreamFromStreamReadable(
- streamReadable
+ streamReadable,
);
};
Readable.wrap = function (src, options) {
@@ -3563,7 +3563,7 @@ var require_readable = __commonJS({
var require_writable = __commonJS({
"node_modules/readable-stream/lib/internal/streams/writable.js"(
exports,
- module
+ module,
) {
"use strict";
var {
@@ -3721,7 +3721,7 @@ var require_writable = __commonJS({
throw new ERR_INVALID_ARG_TYPE(
"chunk",
["string", "Buffer", "Uint8Array"],
- chunk
+ chunk,
);
}
}
@@ -3753,7 +3753,7 @@ var require_writable = __commonJS({
}
};
Writable.prototype.setDefaultEncoding = function setDefaultEncoding(
- encoding
+ encoding,
) {
if (typeof encoding === "string")
encoding = StringPrototypeToLowerCase(encoding);
@@ -3894,7 +3894,7 @@ var require_writable = __commonJS({
callback(
(_state$errored = state.errored) !== null && _state$errored !== void 0
? _state$errored
- : new ERR_STREAM_DESTROYED("write")
+ : new ERR_STREAM_DESTROYED("write"),
);
}
const onfinishCallbacks = state[kOnFinished].splice(0);
@@ -3904,7 +3904,7 @@ var require_writable = __commonJS({
(_state$errored2 = state.errored) !== null &&
_state$errored2 !== void 0
? _state$errored2
- : new ERR_STREAM_DESTROYED("end")
+ : new ERR_STREAM_DESTROYED("end"),
);
}
resetBuffer(state);
@@ -3968,7 +3968,7 @@ var require_writable = __commonJS({
encoding,
},
],
- cb
+ cb,
);
} else {
throw new ERR_METHOD_NOT_IMPLEMENTED("_write()");
@@ -4035,7 +4035,7 @@ var require_writable = __commonJS({
if (called) {
errorOrDestroy(
stream,
- err !== null && err !== void 0 ? err : ERR_MULTIPLE_CALLBACK()
+ err !== null && err !== void 0 ? err : ERR_MULTIPLE_CALLBACK(),
);
return;
}
@@ -4089,7 +4089,7 @@ var require_writable = __commonJS({
}
},
stream,
- state
+ state,
);
} else if (needFinish(state)) {
state.pendingcb++;
@@ -4238,12 +4238,12 @@ var require_writable = __commonJS({
Writable.fromWeb = function (writableStream, options) {
return lazyWebStreams().newStreamWritableFromWritableStream(
writableStream,
- options
+ options,
);
};
Writable.toWeb = function (streamWritable) {
return lazyWebStreams().newWritableStreamFromStreamWritable(
- streamWritable
+ streamWritable,
);
};
},
@@ -4253,7 +4253,7 @@ var require_writable = __commonJS({
var require_duplexify = __commonJS({
"node_modules/readable-stream/lib/internal/streams/duplexify.js"(
exports,
- module
+ module,
) {
"use strict";
var bufferModule = __require("buffer");
@@ -4356,7 +4356,7 @@ var require_duplexify = __commonJS({
},
(err) => {
destroyer(d, err);
- }
+ },
);
return (d = new Duplexify({
objectMode: true,
@@ -4378,7 +4378,7 @@ var require_duplexify = __commonJS({
throw new ERR_INVALID_RETURN_VALUE(
"Iterable, AsyncIterable or AsyncFunction",
name,
- value
+ value,
);
}
if (isBlob(body)) {
@@ -4399,7 +4399,7 @@ var require_duplexify = __commonJS({
const readable =
body !== null && body !== void 0 && body.readable
? isReadableNodeStream(
- body === null || body === void 0 ? void 0 : body.readable
+ body === null || body === void 0 ? void 0 : body.readable,
)
? body === null || body === void 0
? void 0
@@ -4409,7 +4409,7 @@ var require_duplexify = __commonJS({
const writable =
body !== null && body !== void 0 && body.writable
? isWritableNodeStream(
- body === null || body === void 0 ? void 0 : body.writable
+ body === null || body === void 0 ? void 0 : body.writable,
)
? body === null || body === void 0
? void 0
@@ -4435,7 +4435,7 @@ var require_duplexify = __commonJS({
},
(err) => {
destroyer(d, err);
- }
+ },
);
return (d = new Duplexify({
objectMode: true,
@@ -4456,7 +4456,7 @@ var require_duplexify = __commonJS({
"{ readable, writable } pair",
"Promise",
],
- body
+ body,
);
};
function fromAsyncGen(fn) {
@@ -4481,7 +4481,7 @@ var require_duplexify = __commonJS({
})(),
{
signal,
- }
+ },
);
return {
value,
@@ -4635,7 +4635,7 @@ var require_duplexify = __commonJS({
var require_duplex = __commonJS({
"node_modules/readable-stream/lib/internal/streams/duplex.js"(
exports,
- module
+ module,
) {
"use strict";
var {
@@ -4686,35 +4686,35 @@ var require_duplex = __commonJS({
writable: ObjectGetOwnPropertyDescriptor(Writable.prototype, "writable"),
writableHighWaterMark: ObjectGetOwnPropertyDescriptor(
Writable.prototype,
- "writableHighWaterMark"
+ "writableHighWaterMark",
),
writableObjectMode: ObjectGetOwnPropertyDescriptor(
Writable.prototype,
- "writableObjectMode"
+ "writableObjectMode",
),
writableBuffer: ObjectGetOwnPropertyDescriptor(
Writable.prototype,
- "writableBuffer"
+ "writableBuffer",
),
writableLength: ObjectGetOwnPropertyDescriptor(
Writable.prototype,
- "writableLength"
+ "writableLength",
),
writableFinished: ObjectGetOwnPropertyDescriptor(
Writable.prototype,
- "writableFinished"
+ "writableFinished",
),
writableCorked: ObjectGetOwnPropertyDescriptor(
Writable.prototype,
- "writableCorked"
+ "writableCorked",
),
writableEnded: ObjectGetOwnPropertyDescriptor(
Writable.prototype,
- "writableEnded"
+ "writableEnded",
),
writableNeedDrain: ObjectGetOwnPropertyDescriptor(
Writable.prototype,
- "writableNeedDrain"
+ "writableNeedDrain",
),
destroyed: {
get() {
@@ -4742,7 +4742,7 @@ var require_duplex = __commonJS({
Duplex.fromWeb = function (pair, options) {
return lazyWebStreams().newStreamDuplexFromReadableWritablePair(
pair,
- options
+ options,
);
};
Duplex.toWeb = function (duplex) {
@@ -4762,7 +4762,7 @@ var require_duplex = __commonJS({
var require_transform = __commonJS({
"node_modules/readable-stream/lib/internal/streams/transform.js"(
exports,
- module
+ module,
) {
"use strict";
var { ObjectSetPrototypeOf, Symbol: Symbol2 } = require_primordials();
@@ -4857,7 +4857,7 @@ var require_transform = __commonJS({
var require_passthrough = __commonJS({
"node_modules/readable-stream/lib/internal/streams/passthrough.js"(
exports,
- module
+ module,
) {
"use strict";
var Transform = require_transform();
@@ -4881,7 +4881,7 @@ var require_passthrough = __commonJS({
var require_pipeline = __commonJS({
"node_modules/readable-stream/lib/internal/streams/pipeline.js"(
exports,
- module
+ module,
) {
"use strict";
var {
@@ -4924,7 +4924,7 @@ var require_pipeline = __commonJS({
},
(err) => {
finished = !err;
- }
+ },
);
return {
destroy: (err) => {
@@ -4932,7 +4932,7 @@ var require_pipeline = __commonJS({
finished = true;
destroyImpl.destroyer(
stream,
- err || new ERR_STREAM_DESTROYED("pipe")
+ err || new ERR_STREAM_DESTROYED("pipe"),
);
},
cleanup,
@@ -4941,7 +4941,7 @@ var require_pipeline = __commonJS({
function popCallback(streams) {
validateFunction(
streams[streams.length - 1],
- "streams[stream.length - 1]"
+ "streams[stream.length - 1]",
);
return streams.pop();
}
@@ -4954,7 +4954,7 @@ var require_pipeline = __commonJS({
throw new ERR_INVALID_ARG_TYPE(
"val",
["Readable", "Iterable", "AsyncIterable"],
- val
+ val,
);
}
async function* fromReadable(val) {
@@ -4996,7 +4996,7 @@ var require_pipeline = __commonJS({
{
readable: false,
},
- resume
+ resume,
);
try {
if (writable.writableNeedDrain) {
@@ -5111,7 +5111,7 @@ var require_pipeline = __commonJS({
throw new ERR_INVALID_RETURN_VALUE(
"Iterable, AsyncIterable or Stream",
"source",
- ret
+ ret,
);
}
} else if (isIterable(stream) || isReadableNodeStream(stream)) {
@@ -5129,7 +5129,7 @@ var require_pipeline = __commonJS({
throw new ERR_INVALID_RETURN_VALUE(
"AsyncIterable",
`transform[${i - 1}]`,
- ret
+ ret,
);
}
} else {
@@ -5159,7 +5159,7 @@ var require_pipeline = __commonJS({
(err) => {
pt.destroy(err);
runOnNextTick(finish, err);
- }
+ },
);
} else if (isIterable(ret, true)) {
finishCount++;
@@ -5170,7 +5170,7 @@ var require_pipeline = __commonJS({
throw new ERR_INVALID_RETURN_VALUE(
"AsyncIterable or Promise",
"destination",
- ret
+ ret,
);
}
ret = pt;
@@ -5198,7 +5198,7 @@ var require_pipeline = __commonJS({
throw new ERR_INVALID_ARG_TYPE(
"val",
["Readable", "Iterable", "AsyncIterable"],
- ret
+ ret,
);
}
ret = stream;
@@ -5243,7 +5243,7 @@ var require_pipeline = __commonJS({
} else {
finish(err);
}
- }
+ },
);
return eos(
dst,
@@ -5251,7 +5251,7 @@ var require_pipeline = __commonJS({
readable: false,
writable: true,
},
- finish
+ finish,
);
}
module.exports = {
@@ -5265,7 +5265,7 @@ var require_pipeline = __commonJS({
var require_compose = __commonJS({
"node_modules/readable-stream/lib/internal/streams/compose.js"(
exports,
- module
+ module,
) {
"use strict";
var { pipeline } = require_pipeline();
@@ -5299,14 +5299,14 @@ var require_compose = __commonJS({
throw new ERR_INVALID_ARG_VALUE(
`streams[${n}]`,
orgStreams[n],
- "must be readable"
+ "must be readable",
);
}
if (n > 0 && !isWritable(streams[n])) {
throw new ERR_INVALID_ARG_VALUE(
`streams[${n}]`,
orgStreams[n],
- "must be writable"
+ "must be writable",
);
}
}
@@ -5449,7 +5449,7 @@ var require_promises = __commonJS({
{
signal,
end,
- }
+ },
);
});
}
diff --git a/src/bun.js/url.exports.js b/src/bun.js/url.exports.js
index a59b6de08..f1478e212 100644
--- a/src/bun.js/url.exports.js
+++ b/src/bun.js/url.exports.js
@@ -1,2 +1,452 @@
-"use strict";const{URL:F,URLSearchParams:M,[Symbol.for("Bun.lazy")]:S}=globalThis;function it(s){return typeof s=="string"}function D(s){return typeof s=="object"&&s!==null}function I(s){return s===null}function E(s){return s==null}function ft(s){return s===void 0}function m(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var tt=/^([a-z0-9.+-]+:)/i,st=/:[0-9]*$/,ht=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,et=["<",">",'"',"`"," ","\r",`
-`," "],rt=["{","}","|","\\","^","`"].concat(et),B=["'"].concat(rt),G=["%","/","?",";","#"].concat(B),J=["/","?","#"],ot=255,K=/^[+a-z0-9A-Z_-]{0,63}$/,at=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,nt={javascript:!0,"javascript:":!0},N={javascript:!0,"javascript:":!0},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Z={parse(s){var r=decodeURIComponent;return(s+"").replace(/\+/g," ").split("&").filter(Boolean).reduce(function(t,o,a){var l=o.split("="),f=r(l[0]||""),h=r(l[1]||""),g=t[f];return t[f]=g===void 0?h:[].concat(g,h),t},{})},stringify(s){var r=encodeURIComponent;return Object.keys(s||{}).reduce(function(t,o){return[].concat(s[o]).forEach(function(a){t.push(r(o)+"="+r(a))}),t},[]).join("&").replace(/\s/g,"+")}};function A(s,r,t){if(s&&D(s)&&s instanceof m)return s;var o=new m;return o.parse(s,r,t),o}m.prototype.parse=function(s,r,t){if(!it(s))throw new TypeError("Parameter 'url' must be a string, not "+typeof s);var o=s.indexOf("?"),a=o!==-1&&o<s.indexOf("#")?"?":"#",l=s.split(a),f=/\\/g;l[0]=l[0].replace(f,"/"),s=l.join(a);var h=s;if(h=h.trim(),!t&&s.split("#").length===1){var g=ht.exec(h);if(g)return this.path=h,this.href=h,this.pathname=g[1],g[2]?(this.search=g[2],r?this.query=Z.parse(this.search.substr(1)):this.query=this.search.substr(1)):r&&(this.search="",this.query={}),this}var c=tt.exec(h);if(c){c=c[0];var v=c.toLowerCase();this.protocol=v,h=h.substr(c.length)}if(t||c||h.match(/^\/\/[^@\/]+@[^@\/]+/)){var j=h.substr(0,2)==="//";j&&!(c&&N[c])&&(h=h.substr(2),this.slashes=!0)}if(!N[c]&&(j||c&&!R[c])){for(var u=-1,n=0;n<J.length;n++){var b=h.indexOf(J[n]);b!==-1&&(u===-1||b<u)&&(u=b)}var P,p;u===-1?p=h.lastIndexOf("@"):p=h.lastIndexOf("@",u),p!==-1&&(P=h.slice(0,p),h=h.slice(p+1),this.auth=decodeURIComponent(P)),u=-1;for(var n=0;n<G.length;n++){var b=h.indexOf(G[n]);b!==-1&&(u===-1||b<u)&&(u=b)}u===-1&&(u=h.length),this.host=h.slice(0,u),h=h.slice(u),this.parseHost(),this.hostname=this.hostname||"";var C=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!C)for(var e=this.hostname.split(/\./),n=0,i=e.length;n<i;n++){var d=e[n];if(!!d&&!d.match(K)){for(var y="",x=0,_=d.length;x<_;x++)d.charCodeAt(x)>127?y+="x":y+=d[x];if(!y.match(K)){var q=e.slice(0,n),O=e.slice(n+1),U=d.match(at);U&&(q.push(U[1]),O.unshift(U[2])),O.length&&(h="/"+O.join(".")+h),this.hostname=q.join(".");break}}}this.hostname.length>ot?this.hostname="":this.hostname=this.hostname.toLowerCase(),C||(this.hostname=new F(`https://${this.hostname}`).hostname);var w=this.port?":"+this.port:"",H=this.hostname||"";this.host=H+w,this.href+=this.host,C&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),h[0]!=="/"&&(h="/"+h))}if(!nt[v])for(var n=0,i=B.length;n<i;n++){var L=B[n];if(h.indexOf(L)!==-1){var z=encodeURIComponent(L);z===L&&(z=escape(L)),h=h.split(L).join(z)}}var $=h.indexOf("#");$!==-1&&(this.hash=h.substr($),h=h.slice(0,$));var T=h.indexOf("?");if(T!==-1?(this.search=h.substr(T),this.query=h.substr(T+1),r&&(this.query=Z.parse(this.query)),h=h.slice(0,T)):r&&(this.search="",this.query={}),h&&(this.pathname=h),R[v]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var w=this.pathname||"",Q=this.search||"";this.path=w+Q}return this.href=this.format(),this};function V(s){return it(s)&&(s=A(s)),s instanceof m?s.format():m.prototype.format.call(s)}m.prototype.format=function(){var s=this.auth||"";s&&(s=encodeURIComponent(s),s=s.replace(/%3A/i,":"),s+="@");var r=this.protocol||"",t=this.pathname||"",o=this.hash||"",a=!1,l="";this.host?a=s+this.host:this.hostname&&(a=s+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(a+=":"+this.port)),this.query&&D(this.query)&&Object.keys(this.query).length&&(l=Z.stringify(this.query));var f=this.search||l&&"?"+l||"";return r&&r.substr(-1)!==":"&&(r+=":"),this.slashes||(!r||R[r])&&a!==!1?(a="//"+(a||""),t&&t.charAt(0)!=="/"&&(t="/"+t)):a||(a=""),o&&o.charAt(0)!=="#"&&(o="#"+o),f&&f.charAt(0)!=="?"&&(f="?"+f),t=t.replace(/[?#]/g,function(h){return encodeURIComponent(h)}),f=f.replace("#","%23"),r+a+t+f+o};function W(s,r){return A(s,!1,!0).resolve(r)}m.prototype.resolve=function(s){return this.resolveObject(A(s,!1,!0)).format()};function X(s,r){return s?A(s,!1,!0).resolveObject(r):r}m.prototype.resolveObject=function(s){if(it(s)){var r=new m;r.parse(s,!1,!0),s=r}for(var t=new m,o=Object.keys(this),a=0;a<o.length;a++){var l=o[a];t[l]=this[l]}if(t.hash=s.hash,s.href==="")return t.href=t.format(),t;if(s.slashes&&!s.protocol){for(var f=Object.keys(s),h=0;h<f.length;h++){var g=f[h];g!=="protocol"&&(t[g]=s[g])}return R[t.protocol]&&t.hostname&&!t.pathname&&(t.path=t.pathname="/"),t.href=t.format(),t}if(s.protocol&&s.protocol!==t.protocol){if(!R[s.protocol]){for(var c=Object.keys(s),v=0;v<c.length;v++){var j=c[v];t[j]=s[j]}return t.href=t.format(),t}if(t.protocol=s.protocol,!s.host&&!N[s.protocol]){for(var i=(s.pathname||"").split("/");i.length&&!(s.host=i.shift()););s.host||(s.host=""),s.hostname||(s.hostname=""),i[0]!==""&&i.unshift(""),i.length<2&&i.unshift(""),t.pathname=i.join("/")}else t.pathname=s.pathname;if(t.search=s.search,t.query=s.query,t.host=s.host||"",t.auth=s.auth,t.hostname=s.hostname||s.host,t.port=s.port,t.pathname||t.search){var u=t.pathname||"",n=t.search||"";t.path=u+n}return t.slashes=t.slashes||s.slashes,t.href=t.format(),t}var b=t.pathname&&t.pathname.charAt(0)==="/",P=s.host||s.pathname&&s.pathname.charAt(0)==="/",p=P||b||t.host&&s.pathname,C=p,e=t.pathname&&t.pathname.split("/")||[],i=s.pathname&&s.pathname.split("/")||[],d=t.protocol&&!R[t.protocol];if(d&&(t.hostname="",t.port=null,t.host&&(e[0]===""?e[0]=t.host:e.unshift(t.host)),t.host="",s.protocol&&(s.hostname=null,s.port=null,s.host&&(i[0]===""?i[0]=s.host:i.unshift(s.host)),s.host=null),p=p&&(i[0]===""||e[0]==="")),P)t.host=s.host||s.host===""?s.host:t.host,t.hostname=s.hostname||s.hostname===""?s.hostname:t.hostname,t.search=s.search,t.query=s.query,e=i;else if(i.length)e||(e=[]),e.pop(),e=e.concat(i),t.search=s.search,t.query=s.query;else if(!E(s.search)){if(d){t.hostname=t.host=e.shift();var y=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;y&&(t.auth=y.shift(),t.host=t.hostname=y.shift())}return t.search=s.search,t.query=s.query,(!I(t.pathname)||!I(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!e.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var x=e.slice(-1)[0],_=(t.host||s.host||e.length>1)&&(x==="."||x==="..")||x==="",q=0,O=e.length;O>=0;O--)x=e[O],x==="."?e.splice(O,1):x===".."?(e.splice(O,1),q++):q&&(e.splice(O,1),q--);if(!p&&!C)for(;q--;q)e.unshift("..");p&&e[0]!==""&&(!e[0]||e[0].charAt(0)!=="/")&&e.unshift(""),_&&e.join("/").substr(-1)!=="/"&&e.push("");var U=e[0]===""||e[0]&&e[0].charAt(0)==="/";if(d){t.hostname=t.host=U?"":e.length?e.shift():"";var y=t.host&&t.host.indexOf("@")>0?t.host.split("@"):!1;y&&(t.auth=y.shift(),t.host=t.hostname=y.shift())}return p=p||t.host&&e.length,p&&!U&&e.unshift(""),e.length?t.pathname=e.join("/"):(t.pathname=null,t.path=null),(!I(t.pathname)||!I(t.search))&&(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=s.auth||t.auth,t.slashes=t.slashes||s.slashes,t.href=t.format(),t},m.prototype.parseHost=function(){var s=this.host,r=st.exec(s);r&&(r=r[0],r!==":"&&(this.port=r.substr(1)),s=s.substr(0,s.length-r.length)),s&&(this.hostname=s)};var Y,k;S&&(Y=S("pathToFileURL"),k=S("fileURLToPath"));var ut={parse:A,resolve:W,resolveObject:X,format:V,Url:m,pathToFileURL:Y,fileURLToPath:k,URL:F,URLSearchParams:M};"use strict";export{F as URL,M as URLSearchParams,m as Url,ut as default,k as fileURLToPath,V as format,A as parse,Y as pathToFileURL,W as resolve,X as resolveObject};
+"use strict";
+const { URL: F, URLSearchParams: M, [Symbol.for("Bun.lazy")]: S } = globalThis;
+function it(s) {
+ return typeof s == "string";
+}
+function D(s) {
+ return typeof s == "object" && s !== null;
+}
+function I(s) {
+ return s === null;
+}
+function E(s) {
+ return s == null;
+}
+function ft(s) {
+ return s === void 0;
+}
+function m() {
+ (this.protocol = null),
+ (this.slashes = null),
+ (this.auth = null),
+ (this.host = null),
+ (this.port = null),
+ (this.hostname = null),
+ (this.hash = null),
+ (this.search = null),
+ (this.query = null),
+ (this.pathname = null),
+ (this.path = null),
+ (this.href = null);
+}
+var tt = /^([a-z0-9.+-]+:)/i,
+ st = /:[0-9]*$/,
+ ht = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
+ et = [
+ "<",
+ ">",
+ '"',
+ "`",
+ " ",
+ "\r",
+ `
+`,
+ " ",
+ ],
+ rt = ["{", "}", "|", "\\", "^", "`"].concat(et),
+ B = ["'"].concat(rt),
+ G = ["%", "/", "?", ";", "#"].concat(B),
+ J = ["/", "?", "#"],
+ ot = 255,
+ K = /^[+a-z0-9A-Z_-]{0,63}$/,
+ at = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
+ nt = { javascript: !0, "javascript:": !0 },
+ N = { javascript: !0, "javascript:": !0 },
+ R = {
+ http: !0,
+ https: !0,
+ ftp: !0,
+ gopher: !0,
+ file: !0,
+ "http:": !0,
+ "https:": !0,
+ "ftp:": !0,
+ "gopher:": !0,
+ "file:": !0,
+ },
+ Z = {
+ parse(s) {
+ var r = decodeURIComponent;
+ return (s + "")
+ .replace(/\+/g, " ")
+ .split("&")
+ .filter(Boolean)
+ .reduce(function (t, o, a) {
+ var l = o.split("="),
+ f = r(l[0] || ""),
+ h = r(l[1] || ""),
+ g = t[f];
+ return (t[f] = g === void 0 ? h : [].concat(g, h)), t;
+ }, {});
+ },
+ stringify(s) {
+ var r = encodeURIComponent;
+ return Object.keys(s || {})
+ .reduce(function (t, o) {
+ return (
+ [].concat(s[o]).forEach(function (a) {
+ t.push(r(o) + "=" + r(a));
+ }),
+ t
+ );
+ }, [])
+ .join("&")
+ .replace(/\s/g, "+");
+ },
+ };
+function A(s, r, t) {
+ if (s && D(s) && s instanceof m) return s;
+ var o = new m();
+ return o.parse(s, r, t), o;
+}
+m.prototype.parse = function (s, r, t) {
+ if (!it(s))
+ throw new TypeError("Parameter 'url' must be a string, not " + typeof s);
+ var o = s.indexOf("?"),
+ a = o !== -1 && o < s.indexOf("#") ? "?" : "#",
+ l = s.split(a),
+ f = /\\/g;
+ (l[0] = l[0].replace(f, "/")), (s = l.join(a));
+ var h = s;
+ if (((h = h.trim()), !t && s.split("#").length === 1)) {
+ var g = ht.exec(h);
+ if (g)
+ return (
+ (this.path = h),
+ (this.href = h),
+ (this.pathname = g[1]),
+ g[2]
+ ? ((this.search = g[2]),
+ r
+ ? (this.query = Z.parse(this.search.substr(1)))
+ : (this.query = this.search.substr(1)))
+ : r && ((this.search = ""), (this.query = {})),
+ this
+ );
+ }
+ var c = tt.exec(h);
+ if (c) {
+ c = c[0];
+ var v = c.toLowerCase();
+ (this.protocol = v), (h = h.substr(c.length));
+ }
+ if (t || c || h.match(/^\/\/[^@\/]+@[^@\/]+/)) {
+ var j = h.substr(0, 2) === "//";
+ j && !(c && N[c]) && ((h = h.substr(2)), (this.slashes = !0));
+ }
+ if (!N[c] && (j || (c && !R[c]))) {
+ for (var u = -1, n = 0; n < J.length; n++) {
+ var b = h.indexOf(J[n]);
+ b !== -1 && (u === -1 || b < u) && (u = b);
+ }
+ var P, p;
+ u === -1 ? (p = h.lastIndexOf("@")) : (p = h.lastIndexOf("@", u)),
+ p !== -1 &&
+ ((P = h.slice(0, p)),
+ (h = h.slice(p + 1)),
+ (this.auth = decodeURIComponent(P))),
+ (u = -1);
+ for (var n = 0; n < G.length; n++) {
+ var b = h.indexOf(G[n]);
+ b !== -1 && (u === -1 || b < u) && (u = b);
+ }
+ u === -1 && (u = h.length),
+ (this.host = h.slice(0, u)),
+ (h = h.slice(u)),
+ this.parseHost(),
+ (this.hostname = this.hostname || "");
+ var C =
+ this.hostname[0] === "[" &&
+ this.hostname[this.hostname.length - 1] === "]";
+ if (!C)
+ for (var e = this.hostname.split(/\./), n = 0, i = e.length; n < i; n++) {
+ var d = e[n];
+ if (!!d && !d.match(K)) {
+ for (var y = "", x = 0, _ = d.length; x < _; x++)
+ d.charCodeAt(x) > 127 ? (y += "x") : (y += d[x]);
+ if (!y.match(K)) {
+ var q = e.slice(0, n),
+ O = e.slice(n + 1),
+ U = d.match(at);
+ U && (q.push(U[1]), O.unshift(U[2])),
+ O.length && (h = "/" + O.join(".") + h),
+ (this.hostname = q.join("."));
+ break;
+ }
+ }
+ }
+ this.hostname.length > ot
+ ? (this.hostname = "")
+ : (this.hostname = this.hostname.toLowerCase()),
+ C || (this.hostname = new F(`https://${this.hostname}`).hostname);
+ var w = this.port ? ":" + this.port : "",
+ H = this.hostname || "";
+ (this.host = H + w),
+ (this.href += this.host),
+ C &&
+ ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)),
+ h[0] !== "/" && (h = "/" + h));
+ }
+ if (!nt[v])
+ for (var n = 0, i = B.length; n < i; n++) {
+ var L = B[n];
+ if (h.indexOf(L) !== -1) {
+ var z = encodeURIComponent(L);
+ z === L && (z = escape(L)), (h = h.split(L).join(z));
+ }
+ }
+ var $ = h.indexOf("#");
+ $ !== -1 && ((this.hash = h.substr($)), (h = h.slice(0, $)));
+ var T = h.indexOf("?");
+ if (
+ (T !== -1
+ ? ((this.search = h.substr(T)),
+ (this.query = h.substr(T + 1)),
+ r && (this.query = Z.parse(this.query)),
+ (h = h.slice(0, T)))
+ : r && ((this.search = ""), (this.query = {})),
+ h && (this.pathname = h),
+ R[v] && this.hostname && !this.pathname && (this.pathname = "/"),
+ this.pathname || this.search)
+ ) {
+ var w = this.pathname || "",
+ Q = this.search || "";
+ this.path = w + Q;
+ }
+ return (this.href = this.format()), this;
+};
+function V(s) {
+ return (
+ it(s) && (s = A(s)),
+ s instanceof m ? s.format() : m.prototype.format.call(s)
+ );
+}
+m.prototype.format = function () {
+ var s = this.auth || "";
+ s && ((s = encodeURIComponent(s)), (s = s.replace(/%3A/i, ":")), (s += "@"));
+ var r = this.protocol || "",
+ t = this.pathname || "",
+ o = this.hash || "",
+ a = !1,
+ l = "";
+ this.host
+ ? (a = s + this.host)
+ : this.hostname &&
+ ((a =
+ s +
+ (this.hostname.indexOf(":") === -1
+ ? this.hostname
+ : "[" + this.hostname + "]")),
+ this.port && (a += ":" + this.port)),
+ this.query &&
+ D(this.query) &&
+ Object.keys(this.query).length &&
+ (l = Z.stringify(this.query));
+ var f = this.search || (l && "?" + l) || "";
+ return (
+ r && r.substr(-1) !== ":" && (r += ":"),
+ this.slashes || ((!r || R[r]) && a !== !1)
+ ? ((a = "//" + (a || "")), t && t.charAt(0) !== "/" && (t = "/" + t))
+ : a || (a = ""),
+ o && o.charAt(0) !== "#" && (o = "#" + o),
+ f && f.charAt(0) !== "?" && (f = "?" + f),
+ (t = t.replace(/[?#]/g, function (h) {
+ return encodeURIComponent(h);
+ })),
+ (f = f.replace("#", "%23")),
+ r + a + t + f + o
+ );
+};
+function W(s, r) {
+ return A(s, !1, !0).resolve(r);
+}
+m.prototype.resolve = function (s) {
+ return this.resolveObject(A(s, !1, !0)).format();
+};
+function X(s, r) {
+ return s ? A(s, !1, !0).resolveObject(r) : r;
+}
+(m.prototype.resolveObject = function (s) {
+ if (it(s)) {
+ var r = new m();
+ r.parse(s, !1, !0), (s = r);
+ }
+ for (var t = new m(), o = Object.keys(this), a = 0; a < o.length; a++) {
+ var l = o[a];
+ t[l] = this[l];
+ }
+ if (((t.hash = s.hash), s.href === "")) return (t.href = t.format()), t;
+ if (s.slashes && !s.protocol) {
+ for (var f = Object.keys(s), h = 0; h < f.length; h++) {
+ var g = f[h];
+ g !== "protocol" && (t[g] = s[g]);
+ }
+ return (
+ R[t.protocol] && t.hostname && !t.pathname && (t.path = t.pathname = "/"),
+ (t.href = t.format()),
+ t
+ );
+ }
+ if (s.protocol && s.protocol !== t.protocol) {
+ if (!R[s.protocol]) {
+ for (var c = Object.keys(s), v = 0; v < c.length; v++) {
+ var j = c[v];
+ t[j] = s[j];
+ }
+ return (t.href = t.format()), t;
+ }
+ if (((t.protocol = s.protocol), !s.host && !N[s.protocol])) {
+ for (
+ var i = (s.pathname || "").split("/");
+ i.length && !(s.host = i.shift());
+
+ );
+ s.host || (s.host = ""),
+ s.hostname || (s.hostname = ""),
+ i[0] !== "" && i.unshift(""),
+ i.length < 2 && i.unshift(""),
+ (t.pathname = i.join("/"));
+ } else t.pathname = s.pathname;
+ if (
+ ((t.search = s.search),
+ (t.query = s.query),
+ (t.host = s.host || ""),
+ (t.auth = s.auth),
+ (t.hostname = s.hostname || s.host),
+ (t.port = s.port),
+ t.pathname || t.search)
+ ) {
+ var u = t.pathname || "",
+ n = t.search || "";
+ t.path = u + n;
+ }
+ return (t.slashes = t.slashes || s.slashes), (t.href = t.format()), t;
+ }
+ var b = t.pathname && t.pathname.charAt(0) === "/",
+ P = s.host || (s.pathname && s.pathname.charAt(0) === "/"),
+ p = P || b || (t.host && s.pathname),
+ C = p,
+ e = (t.pathname && t.pathname.split("/")) || [],
+ i = (s.pathname && s.pathname.split("/")) || [],
+ d = t.protocol && !R[t.protocol];
+ if (
+ (d &&
+ ((t.hostname = ""),
+ (t.port = null),
+ t.host && (e[0] === "" ? (e[0] = t.host) : e.unshift(t.host)),
+ (t.host = ""),
+ s.protocol &&
+ ((s.hostname = null),
+ (s.port = null),
+ s.host && (i[0] === "" ? (i[0] = s.host) : i.unshift(s.host)),
+ (s.host = null)),
+ (p = p && (i[0] === "" || e[0] === ""))),
+ P)
+ )
+ (t.host = s.host || s.host === "" ? s.host : t.host),
+ (t.hostname = s.hostname || s.hostname === "" ? s.hostname : t.hostname),
+ (t.search = s.search),
+ (t.query = s.query),
+ (e = i);
+ else if (i.length)
+ e || (e = []),
+ e.pop(),
+ (e = e.concat(i)),
+ (t.search = s.search),
+ (t.query = s.query);
+ else if (!E(s.search)) {
+ if (d) {
+ t.hostname = t.host = e.shift();
+ var y = t.host && t.host.indexOf("@") > 0 ? t.host.split("@") : !1;
+ y && ((t.auth = y.shift()), (t.host = t.hostname = y.shift()));
+ }
+ return (
+ (t.search = s.search),
+ (t.query = s.query),
+ (!I(t.pathname) || !I(t.search)) &&
+ (t.path = (t.pathname ? t.pathname : "") + (t.search ? t.search : "")),
+ (t.href = t.format()),
+ t
+ );
+ }
+ if (!e.length)
+ return (
+ (t.pathname = null),
+ t.search ? (t.path = "/" + t.search) : (t.path = null),
+ (t.href = t.format()),
+ t
+ );
+ for (
+ var x = e.slice(-1)[0],
+ _ =
+ ((t.host || s.host || e.length > 1) && (x === "." || x === "..")) ||
+ x === "",
+ q = 0,
+ O = e.length;
+ O >= 0;
+ O--
+ )
+ (x = e[O]),
+ x === "."
+ ? e.splice(O, 1)
+ : x === ".."
+ ? (e.splice(O, 1), q++)
+ : q && (e.splice(O, 1), q--);
+ if (!p && !C) for (; q--; q) e.unshift("..");
+ p && e[0] !== "" && (!e[0] || e[0].charAt(0) !== "/") && e.unshift(""),
+ _ && e.join("/").substr(-1) !== "/" && e.push("");
+ var U = e[0] === "" || (e[0] && e[0].charAt(0) === "/");
+ if (d) {
+ t.hostname = t.host = U ? "" : e.length ? e.shift() : "";
+ var y = t.host && t.host.indexOf("@") > 0 ? t.host.split("@") : !1;
+ y && ((t.auth = y.shift()), (t.host = t.hostname = y.shift()));
+ }
+ return (
+ (p = p || (t.host && e.length)),
+ p && !U && e.unshift(""),
+ e.length
+ ? (t.pathname = e.join("/"))
+ : ((t.pathname = null), (t.path = null)),
+ (!I(t.pathname) || !I(t.search)) &&
+ (t.path = (t.pathname ? t.pathname : "") + (t.search ? t.search : "")),
+ (t.auth = s.auth || t.auth),
+ (t.slashes = t.slashes || s.slashes),
+ (t.href = t.format()),
+ t
+ );
+}),
+ (m.prototype.parseHost = function () {
+ var s = this.host,
+ r = st.exec(s);
+ r &&
+ ((r = r[0]),
+ r !== ":" && (this.port = r.substr(1)),
+ (s = s.substr(0, s.length - r.length))),
+ s && (this.hostname = s);
+ });
+var Y, k;
+S && ((Y = S("pathToFileURL")), (k = S("fileURLToPath")));
+var ut = {
+ parse: A,
+ resolve: W,
+ resolveObject: X,
+ format: V,
+ Url: m,
+ pathToFileURL: Y,
+ fileURLToPath: k,
+ URL: F,
+ URLSearchParams: M,
+};
+("use strict");
+export {
+ F as URL,
+ M as URLSearchParams,
+ m as Url,
+ ut as default,
+ k as fileURLToPath,
+ V as format,
+ A as parse,
+ Y as pathToFileURL,
+ W as resolve,
+ X as resolveObject,
+};
diff --git a/src/bun.js/ws.exports.js b/src/bun.js/ws.exports.js
index 90d3f8911..d7a79b0b7 100644
--- a/src/bun.js/ws.exports.js
+++ b/src/bun.js/ws.exports.js
@@ -81,7 +81,7 @@ var Receiver = (BunWebSocket.Receiver = class Receiver {
});
var createWebSocketStream = (BunWebSocket.createWebSocketStream = function (
- ws
+ ws,
) {
throw new Error("Not supported in Bun");
});
diff --git a/src/cli/tsconfig-for-init.json b/src/cli/tsconfig-for-init.json
index a659f9e5b..30522c12f 100644
--- a/src/cli/tsconfig-for-init.json
+++ b/src/cli/tsconfig-for-init.json
@@ -5,15 +5,16 @@
],
"module": "esnext",
"target": "esnext",
- "moduleResolution": "node",
+ "moduleResolution": "nodenext",
"strict": true,
+ "downlevelIteration": true,
"skipLibCheck": true,
+ "jsx": "preserve",
+ "allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
- // so that if your project isn't using TypeScript, it still has autocomplete
"allowJs": true,
- // "bun-types" is the important part
"types": [
- "bun-types"
+ "bun-types" // add Bun global
]
}
} \ No newline at end of file
diff --git a/src/fallback.ts b/src/fallback.ts
index 103c9db1d..964ed4e92 100644
--- a/src/fallback.ts
+++ b/src/fallback.ts
@@ -1,3 +1,4 @@
+declare var document: any;
import { ByteBuffer } from "peechy";
import { FallbackStep } from "./api/schema";
import {
@@ -7,7 +8,7 @@ import {
function getFallbackInfo(): FallbackMessageContainer {
const binary_string = globalThis.atob(
- document.getElementById("__bunfallback").textContent.trim()
+ document.getElementById("__bunfallback").textContent.trim(),
);
var len = binary_string.length;
diff --git a/src/node-fallbacks/@vercel_fetch.js b/src/node-fallbacks/@vercel_fetch.js
index 95314ba9e..f75604b2b 100644
--- a/src/node-fallbacks/@vercel_fetch.js
+++ b/src/node-fallbacks/@vercel_fetch.js
@@ -1,6 +1,6 @@
// This is just a no-op. Intent is to prevent importing a bunch of stuff that isn't relevant.
module.exports = (
- wrapper = "Bun" in globalThis ? Bun.fetch : globalThis.fetch
+ wrapper = "Bun" in globalThis ? Bun.fetch : globalThis.fetch,
) => {
async function vercelFetch(url, opts = {}) {
// Convert Object bodies to JSON if they are JS objects
diff --git a/src/node-fallbacks/assert.js b/src/node-fallbacks/assert.js
index a62319d0a..3636f90e3 100644
--- a/src/node-fallbacks/assert.js
+++ b/src/node-fallbacks/assert.js
@@ -1 +1 @@
-export * from 'assert'; \ No newline at end of file
+export * from "assert";
diff --git a/src/node-fallbacks/events.js b/src/node-fallbacks/events.js
index e5b3d28df..738bf1f15 100644
--- a/src/node-fallbacks/events.js
+++ b/src/node-fallbacks/events.js
@@ -35,7 +35,7 @@ if (R && typeof R.ownKeys === "function") {
} else if (Object.getOwnPropertySymbols) {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target).concat(
- Object.getOwnPropertySymbols(target)
+ Object.getOwnPropertySymbols(target),
);
};
} else {
@@ -73,7 +73,7 @@ function checkListener(listener) {
if (typeof listener !== "function") {
throw new TypeError(
'The "listener" argument must be of type Function. Received type ' +
- typeof listener
+ typeof listener,
);
}
}
@@ -88,7 +88,7 @@ Object.defineProperty(EventEmitter, "defaultMaxListeners", {
throw new RangeError(
'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' +
arg +
- "."
+ ".",
);
}
defaultMaxListeners = arg;
@@ -114,7 +114,7 @@ EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
throw new RangeError(
'The value of "n" is out of range. It must be a non-negative number. Received ' +
n +
- "."
+ ".",
);
}
this._maxListeners = n;
@@ -150,7 +150,7 @@ EventEmitter.prototype.emit = function emit(type) {
}
// At least give some kind of context to the user
var err = new Error(
- "Unhandled error." + (er ? " (" + er.message + ")" : "")
+ "Unhandled error." + (er ? " (" + er.message + ")" : ""),
);
err.context = er;
throw err; // Unhandled 'error' event
@@ -189,7 +189,7 @@ function _addListener(target, type, listener, prepend) {
target.emit(
"newListener",
type,
- listener.listener ? listener.listener : listener
+ listener.listener ? listener.listener : listener,
);
// Re-assign `events` because a newListener handler could have caused the
@@ -229,7 +229,7 @@ function _addListener(target, type, listener, prepend) {
String(type) +
" listeners " +
"added. Use emitter.setMaxListeners() to " +
- "increase limit"
+ "increase limit",
);
w.name = "MaxListenersExceededWarning";
w.emitter = target;
@@ -250,7 +250,7 @@ EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.prependListener = function prependListener(
type,
- listener
+ listener,
) {
return _addListener(this, type, listener, true);
};
@@ -286,7 +286,7 @@ EventEmitter.prototype.once = function once(type, listener) {
EventEmitter.prototype.prependOnceListener = function prependOnceListener(
type,
- listener
+ listener,
) {
checkListener(listener);
this.prependListener(type, _onceWrap(this, type, listener));
@@ -296,7 +296,7 @@ EventEmitter.prototype.prependOnceListener = function prependOnceListener(
// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener = function removeListener(
type,
- listener
+ listener,
) {
var list, events, position, i, originalListener;
@@ -511,7 +511,7 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
} else {
throw new TypeError(
'The "emitter" argument must be of type EventEmitter. Received type ' +
- typeof emitter
+ typeof emitter,
);
}
}
diff --git a/src/node-fallbacks/net.js b/src/node-fallbacks/net.js
index 8f58ce134..77afb4980 100644
--- a/src/node-fallbacks/net.js
+++ b/src/node-fallbacks/net.js
@@ -20,22 +20,24 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// IPv4 Segment
-const v4Seg = '(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
+const v4Seg = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])";
const v4Str = `(${v4Seg}[.]){3}${v4Seg}`;
const IPv4Reg = new RegExp(`^${v4Str}$`);
// IPv6 Segment
-const v6Seg = '(?:[0-9a-fA-F]{1,4})';
-const IPv6Reg = new RegExp('^(' +
- `(?:${v6Seg}:){7}(?:${v6Seg}|:)|` +
- `(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|` +
- `(?:${v6Seg}:){5}(?::${v4Str}|(:${v6Seg}){1,2}|:)|` +
- `(?:${v6Seg}:){4}(?:(:${v6Seg}){0,1}:${v4Str}|(:${v6Seg}){1,3}|:)|` +
- `(?:${v6Seg}:){3}(?:(:${v6Seg}){0,2}:${v4Str}|(:${v6Seg}){1,4}|:)|` +
- `(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` +
- `(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` +
- `(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` +
-')(%[0-9a-zA-Z-.:]{1,})?$');
+const v6Seg = "(?:[0-9a-fA-F]{1,4})";
+const IPv6Reg = new RegExp(
+ "^(" +
+ `(?:${v6Seg}:){7}(?:${v6Seg}|:)|` +
+ `(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|` +
+ `(?:${v6Seg}:){5}(?::${v4Str}|(:${v6Seg}){1,2}|:)|` +
+ `(?:${v6Seg}:){4}(?:(:${v6Seg}){0,1}:${v4Str}|(:${v6Seg}){1,3}|:)|` +
+ `(?:${v6Seg}:){3}(?:(:${v6Seg}){0,2}:${v4Str}|(:${v6Seg}){1,4}|:)|` +
+ `(?:${v6Seg}:){2}(?:(:${v6Seg}){0,3}:${v4Str}|(:${v6Seg}){1,5}|:)|` +
+ `(?:${v6Seg}:){1}(?:(:${v6Seg}){0,4}:${v4Str}|(:${v6Seg}){1,6}|:)|` +
+ `(?::((?::${v6Seg}){0,5}:${v4Str}|(?::${v6Seg}){1,7}|:))` +
+ ")(%[0-9a-zA-Z-.:]{1,})?$",
+);
export function isIPv4(s) {
return IPv4Reg.test(s);
@@ -55,4 +57,4 @@ export default {
isIP,
isIPv4,
isIPv6,
-} \ No newline at end of file
+};
diff --git a/src/react-refresh.js b/src/react-refresh.js
index 65c44002f..d3453d591 100644
--- a/src/react-refresh.js
+++ b/src/react-refresh.js
@@ -4,6 +4,345 @@
// - inlined REACT_MEMO_TYPE & REACT_FORWARD_REF_TYPE
// - minified
-const F="for"in Symbol?Symbol.for("react.forward_ref"):60112,C="for"in Symbol?Symbol.for("react.memo"):60115,O=typeof WeakMap=="function"?WeakMap:Map,T=new Map,k=new O,m=new O,M=new O;let g=[];const b=new Map,w=new Map,c=new Set,p=new Set,R=typeof WeakMap=="function"?new WeakMap:null;let S=!1;function _(e){if(e.fullKey!==null)return e.fullKey;let t=e.ownKey,n;try{n=e.getCustomHooks()}catch{return e.forceReset=!0,e.fullKey=t,t}for(let o=0;o<n.length;o++){const l=n[o];if(typeof l!="function")return e.forceReset=!0,e.fullKey=t,t;const s=m.get(l);if(s===void 0)continue;const r=_(s);s.forceReset&&(e.forceReset=!0),t+=`
+const F = "for" in Symbol ? Symbol.for("react.forward_ref") : 60112,
+ C = "for" in Symbol ? Symbol.for("react.memo") : 60115,
+ O = typeof WeakMap == "function" ? WeakMap : Map,
+ T = new Map(),
+ k = new O(),
+ m = new O(),
+ M = new O();
+let g = [];
+const b = new Map(),
+ w = new Map(),
+ c = new Set(),
+ p = new Set(),
+ R = typeof WeakMap == "function" ? new WeakMap() : null;
+let S = !1;
+function _(e) {
+ if (e.fullKey !== null) return e.fullKey;
+ let t = e.ownKey,
+ n;
+ try {
+ n = e.getCustomHooks();
+ } catch {
+ return (e.forceReset = !0), (e.fullKey = t), t;
+ }
+ for (let o = 0; o < n.length; o++) {
+ const l = n[o];
+ if (typeof l != "function") return (e.forceReset = !0), (e.fullKey = t), t;
+ const s = m.get(l);
+ if (s === void 0) continue;
+ const r = _(s);
+ s.forceReset && (e.forceReset = !0),
+ (t +=
+ `
---
-`+r}return e.fullKey=t,t}function D(e,t){const n=m.get(e),o=m.get(t);return n===void 0&&o===void 0?!0:!(n===void 0||o===void 0||_(n)!==_(o)||o.forceReset)}function B(e){return e.prototype&&e.prototype.isReactComponent}function v(e,t){return B(e)||B(t)?!1:!!D(e,t)}function I(e){return M.get(e)}function P(e){const t=new Map;return e.forEach((n,o)=>{t.set(o,n)}),t}function L(e){const t=new Set;return e.forEach(n=>{t.add(n)}),t}function H(e,t){try{return e[t]}catch{return}}function j(){if(g.length===0||S)return null;S=!0;try{const e=new Set,t=new Set,n=g;g=[],n.forEach(f=>{let[i,u]=f;const a=i.current;M.set(a,i),M.set(u,i),i.current=u,v(a,u)?t.add(i):e.add(i)});const o={updatedFamilies:t,staleFamilies:e};b.forEach(f=>{f.setRefreshHandler(I)});let l=!1,s=null;const r=L(p),h=L(c),d=P(w);if(r.forEach(f=>{const i=d.get(f);if(i===void 0)throw new Error("Could not find helpers for a root. This is a bug in React Refresh.");if(!p.has(f),R===null||!R.has(f))return;const u=R.get(f);try{i.scheduleRoot(f,u)}catch(a){l||(l=!0,s=a)}}),h.forEach(f=>{const i=d.get(f);if(i===void 0)throw new Error("Could not find helpers for a root. This is a bug in React Refresh.");!c.has(f);try{i.scheduleRefresh(f,o)}catch(u){l||(l=!0,s=u)}}),l)throw s;return o}finally{S=!1}}function K(e,t){if(e===null||typeof e!="function"&&typeof e!="object"||k.has(e))return;let n=T.get(t);if(n===void 0?(n={current:e},T.set(t,n)):g.push([n,e]),k.set(e,n),typeof e=="object"&&e!==null)switch(H(e,"$$typeof")){case F:K(e.render,t+"$render");break;case C:K(e.type,t+"$type");break}}function E(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,o=arguments.length>3?arguments[3]:void 0;if(m.has(e)||m.set(e,{forceReset:n,ownKey:t,fullKey:null,getCustomHooks:o||(()=>[])}),typeof e=="object"&&e!==null)switch(H(e,"$$typeof")){case F:E(e.render,t,n,o);break;case C:E(e.type,t,n,o);break}}function A(e){const t=m.get(e);t!==void 0&&_(t)}function $(e){return T.get(e)}function W(e){return k.get(e)}function x(e){const t=new Set;return c.forEach(n=>{const o=w.get(n);if(o===void 0)throw new Error("Could not find helpers for a root. This is a bug in React Refresh.");o.findHostInstancesForRefresh(n,e).forEach(s=>{t.add(s)})}),t}function z(e){let t=e.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t===void 0){let s=0;e.__REACT_DEVTOOLS_GLOBAL_HOOK__=t={renderers:new Map,supportsFiber:!0,inject(r){return s++},onScheduleFiberRoot(r,h,d){},onCommitFiberRoot(r,h,d,f){},onCommitFiberUnmount(){}}}if(t.isDisabled){console.warn("Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). Fast Refresh is not compatible with this shim and will be disabled.");return}const n=t.inject;t.inject=function(s){const r=n.apply(this,arguments);return typeof s.scheduleRefresh=="function"&&typeof s.setRefreshHandler=="function"&&b.set(r,s),r},t.renderers.forEach((s,r)=>{typeof s.scheduleRefresh=="function"&&typeof s.setRefreshHandler=="function"&&b.set(r,s)});const o=t.onCommitFiberRoot,l=t.onScheduleFiberRoot||(()=>{});t.onScheduleFiberRoot=function(s,r,h){return S||(p.delete(r),R!==null&&R.set(r,h)),l.apply(this,arguments)},t.onCommitFiberRoot=function(s,r,h,d){const f=b.get(s);if(f!==void 0){w.set(r,f);const i=r.current,u=i.alternate;if(u!==null){const a=u.memoizedState!=null&&u.memoizedState.element!=null&&c.has(r),y=i.memoizedState!=null&&i.memoizedState.element!=null;!a&&y?(c.add(r),p.delete(r)):a&&y||(a&&!y?(c.delete(r),d?p.add(r):w.delete(r)):!a&&!y&&d&&p.add(r))}else c.add(r)}return o.apply(this,arguments)}}function G(){return!1}function N(){return c.size}function U(){let e,t,n=!1;return function(o,l,s,r){if(typeof l=="string")return e||(e=o,t=typeof r=="function"),o!=null&&(typeof o=="function"||typeof o=="object")&&E(o,l,s,r),o;!n&&t&&(n=!0,A(e))}}function V(e){switch(typeof e){case"function":{if(e.prototype!=null){if(e.prototype.isReactComponent)return!0;const n=Object.getOwnPropertyNames(e.prototype);if(n.length>1||n[0]!=="constructor"||e.prototype.__proto__!==Object.prototype)return!1}const t=e.name||e.displayName;return typeof t=="string"&&/^[A-Z]/.test(t)}case"object":{if(e!=null)switch(H(e,"$$typeof")){case F:case C:return!0;default:return!1}return!1}default:return!1}}export{N as _getMountedRootCount,A as collectCustomHooksForSignature,U as createSignatureFunctionForTransform,x as findAffectedHostInstances,$ as getFamilyByID,W as getFamilyByType,G as hasUnrecoverableErrors,z as injectIntoGlobalHook,V as isLikelyComponentType,j as performReactRefresh,K as register,E as setSignature};
+` + r);
+ }
+ return (e.fullKey = t), t;
+}
+function D(e, t) {
+ const n = m.get(e),
+ o = m.get(t);
+ return n === void 0 && o === void 0
+ ? !0
+ : !(n === void 0 || o === void 0 || _(n) !== _(o) || o.forceReset);
+}
+function B(e) {
+ return e.prototype && e.prototype.isReactComponent;
+}
+function v(e, t) {
+ return B(e) || B(t) ? !1 : !!D(e, t);
+}
+function I(e) {
+ return M.get(e);
+}
+function P(e) {
+ const t = new Map();
+ return (
+ e.forEach((n, o) => {
+ t.set(o, n);
+ }),
+ t
+ );
+}
+function L(e) {
+ const t = new Set();
+ return (
+ e.forEach((n) => {
+ t.add(n);
+ }),
+ t
+ );
+}
+function H(e, t) {
+ try {
+ return e[t];
+ } catch {
+ return;
+ }
+}
+function j() {
+ if (g.length === 0 || S) return null;
+ S = !0;
+ try {
+ const e = new Set(),
+ t = new Set(),
+ n = g;
+ (g = []),
+ n.forEach((f) => {
+ let [i, u] = f;
+ const a = i.current;
+ M.set(a, i),
+ M.set(u, i),
+ (i.current = u),
+ v(a, u) ? t.add(i) : e.add(i);
+ });
+ const o = { updatedFamilies: t, staleFamilies: e };
+ b.forEach((f) => {
+ f.setRefreshHandler(I);
+ });
+ let l = !1,
+ s = null;
+ const r = L(p),
+ h = L(c),
+ d = P(w);
+ if (
+ (r.forEach((f) => {
+ const i = d.get(f);
+ if (i === void 0)
+ throw new Error(
+ "Could not find helpers for a root. This is a bug in React Refresh.",
+ );
+ if ((!p.has(f), R === null || !R.has(f))) return;
+ const u = R.get(f);
+ try {
+ i.scheduleRoot(f, u);
+ } catch (a) {
+ l || ((l = !0), (s = a));
+ }
+ }),
+ h.forEach((f) => {
+ const i = d.get(f);
+ if (i === void 0)
+ throw new Error(
+ "Could not find helpers for a root. This is a bug in React Refresh.",
+ );
+ !c.has(f);
+ try {
+ i.scheduleRefresh(f, o);
+ } catch (u) {
+ l || ((l = !0), (s = u));
+ }
+ }),
+ l)
+ )
+ throw s;
+ return o;
+ } finally {
+ S = !1;
+ }
+}
+function K(e, t) {
+ if (
+ e === null ||
+ (typeof e != "function" && typeof e != "object") ||
+ k.has(e)
+ )
+ return;
+ let n = T.get(t);
+ if (
+ (n === void 0 ? ((n = { current: e }), T.set(t, n)) : g.push([n, e]),
+ k.set(e, n),
+ typeof e == "object" && e !== null)
+ )
+ switch (H(e, "$$typeof")) {
+ case F:
+ K(e.render, t + "$render");
+ break;
+ case C:
+ K(e.type, t + "$type");
+ break;
+ }
+}
+function E(e, t) {
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1,
+ o = arguments.length > 3 ? arguments[3] : void 0;
+ if (
+ (m.has(e) ||
+ m.set(e, {
+ forceReset: n,
+ ownKey: t,
+ fullKey: null,
+ getCustomHooks: o || (() => []),
+ }),
+ typeof e == "object" && e !== null)
+ )
+ switch (H(e, "$$typeof")) {
+ case F:
+ E(e.render, t, n, o);
+ break;
+ case C:
+ E(e.type, t, n, o);
+ break;
+ }
+}
+function A(e) {
+ const t = m.get(e);
+ t !== void 0 && _(t);
+}
+function $(e) {
+ return T.get(e);
+}
+function W(e) {
+ return k.get(e);
+}
+function x(e) {
+ const t = new Set();
+ return (
+ c.forEach((n) => {
+ const o = w.get(n);
+ if (o === void 0)
+ throw new Error(
+ "Could not find helpers for a root. This is a bug in React Refresh.",
+ );
+ o.findHostInstancesForRefresh(n, e).forEach((s) => {
+ t.add(s);
+ });
+ }),
+ t
+ );
+}
+function z(e) {
+ let t = e.__REACT_DEVTOOLS_GLOBAL_HOOK__;
+ if (t === void 0) {
+ let s = 0;
+ e.__REACT_DEVTOOLS_GLOBAL_HOOK__ = t = {
+ renderers: new Map(),
+ supportsFiber: !0,
+ inject(r) {
+ return s++;
+ },
+ onScheduleFiberRoot(r, h, d) {},
+ onCommitFiberRoot(r, h, d, f) {},
+ onCommitFiberUnmount() {},
+ };
+ }
+ if (t.isDisabled) {
+ console.warn(
+ "Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). Fast Refresh is not compatible with this shim and will be disabled.",
+ );
+ return;
+ }
+ const n = t.inject;
+ (t.inject = function (s) {
+ const r = n.apply(this, arguments);
+ return (
+ typeof s.scheduleRefresh == "function" &&
+ typeof s.setRefreshHandler == "function" &&
+ b.set(r, s),
+ r
+ );
+ }),
+ t.renderers.forEach((s, r) => {
+ typeof s.scheduleRefresh == "function" &&
+ typeof s.setRefreshHandler == "function" &&
+ b.set(r, s);
+ });
+ const o = t.onCommitFiberRoot,
+ l = t.onScheduleFiberRoot || (() => {});
+ (t.onScheduleFiberRoot = function (s, r, h) {
+ return (
+ S || (p.delete(r), R !== null && R.set(r, h)), l.apply(this, arguments)
+ );
+ }),
+ (t.onCommitFiberRoot = function (s, r, h, d) {
+ const f = b.get(s);
+ if (f !== void 0) {
+ w.set(r, f);
+ const i = r.current,
+ u = i.alternate;
+ if (u !== null) {
+ const a =
+ u.memoizedState != null &&
+ u.memoizedState.element != null &&
+ c.has(r),
+ y = i.memoizedState != null && i.memoizedState.element != null;
+ !a && y
+ ? (c.add(r), p.delete(r))
+ : (a && y) ||
+ (a && !y
+ ? (c.delete(r), d ? p.add(r) : w.delete(r))
+ : !a && !y && d && p.add(r));
+ } else c.add(r);
+ }
+ return o.apply(this, arguments);
+ });
+}
+function G() {
+ return !1;
+}
+function N() {
+ return c.size;
+}
+function U() {
+ let e,
+ t,
+ n = !1;
+ return function (o, l, s, r) {
+ if (typeof l == "string")
+ return (
+ e || ((e = o), (t = typeof r == "function")),
+ o != null &&
+ (typeof o == "function" || typeof o == "object") &&
+ E(o, l, s, r),
+ o
+ );
+ !n && t && ((n = !0), A(e));
+ };
+}
+function V(e) {
+ switch (typeof e) {
+ case "function": {
+ if (e.prototype != null) {
+ if (e.prototype.isReactComponent) return !0;
+ const n = Object.getOwnPropertyNames(e.prototype);
+ if (
+ n.length > 1 ||
+ n[0] !== "constructor" ||
+ e.prototype.__proto__ !== Object.prototype
+ )
+ return !1;
+ }
+ const t = e.name || e.displayName;
+ return typeof t == "string" && /^[A-Z]/.test(t);
+ }
+ case "object": {
+ if (e != null)
+ switch (H(e, "$$typeof")) {
+ case F:
+ case C:
+ return !0;
+ default:
+ return !1;
+ }
+ return !1;
+ }
+ default:
+ return !1;
+ }
+}
+export {
+ N as _getMountedRootCount,
+ A as collectCustomHooksForSignature,
+ U as createSignatureFunctionForTransform,
+ x as findAffectedHostInstances,
+ $ as getFamilyByID,
+ W as getFamilyByType,
+ G as hasUnrecoverableErrors,
+ z as injectIntoGlobalHook,
+ V as isLikelyComponentType,
+ j as performReactRefresh,
+ K as register,
+ E as setSignature,
+};
diff --git a/src/runtime.footer.node.js b/src/runtime.footer.node.js
index a6e425e44..b32dc78fa 100644
--- a/src/runtime.footer.node.js
+++ b/src/runtime.footer.node.js
@@ -48,7 +48,7 @@ var process =
target = process = _process;
return Reflect.has(_process, prop, receiver);
},
- }
+ },
);
var Buffer =
@@ -81,5 +81,5 @@ var Buffer =
target = Buffer = NewBuffer;
return Reflect.has(NewBuffer, prop, receiver);
},
- }
+ },
);
diff --git a/src/runtime.js b/src/runtime.js
index fe2f5b9df..b39eaed9d 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -45,10 +45,10 @@ export var __toModule = (module) => {
"default",
module && module.__esModule && "default" in module
? { get: () => module.default, enumerable: true, configurable: true }
- : { value: module, enumerable: true, configurable: true }
- )
+ : { value: module, enumerable: true, configurable: true },
+ ),
),
- module
+ module,
);
};
@@ -83,12 +83,12 @@ export var __commonJS = (cb, name) => {
Object.setPrototypeOf(mod_exports, __getProtoOf(origExports));
Object.defineProperties(
mod_exports,
- Object.getOwnPropertyDescriptors(origExports)
+ Object.getOwnPropertyDescriptors(origExports),
);
} else {
mod_exports = __create(
__getProtoOf(mod_exports),
- Object.getOwnPropertyDescriptors(mod_exports)
+ Object.getOwnPropertyDescriptors(mod_exports),
);
}
}
@@ -237,13 +237,15 @@ export var __merge = (props, defaultProps) => {
};
export var __decorateClass = (decorators, target, key, kind) => {
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
+ var result =
+ kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
for (var i = decorators.length - 1, decorator; i >= 0; i--)
- if (decorator = decorators[i])
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
- if (kind && result)
- __defProp(target, key, result);
+ if ((decorator = decorators[i]))
+ result =
+ (kind ? decorator(target, key, result) : decorator(result)) || result;
+ if (kind && result) __defProp(target, key, result);
return result;
};
-export var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index); \ No newline at end of file
+export var __decorateParam = (index, decorator) => (target, key) =>
+ decorator(target, key, index);
diff --git a/src/runtime/errors.ts b/src/runtime/errors.ts
index ad54cc322..5affd14f1 100644
--- a/src/runtime/errors.ts
+++ b/src/runtime/errors.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
var __BuildError;
var __ResolveError;
var __ImportKind;
diff --git a/src/runtime/hmr.ts b/src/runtime/hmr.ts
index 2882744db..96122feba 100644
--- a/src/runtime/hmr.ts
+++ b/src/runtime/hmr.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
import { ByteBuffer } from "peechy";
import * as API from "../api/schema";
@@ -178,7 +179,7 @@ if (typeof window !== "undefined") {
private findMatchingSupportsRule(
rule: CSSSupportsRule,
id: number,
- sheet: CSSStyleSheet
+ sheet: CSSStyleSheet,
): CSSHMRInsertionPoint | null {
switch (rule.type) {
// 12 is result.SUPPORTS_RULE
@@ -193,7 +194,7 @@ if (typeof window !== "undefined") {
const int = parseInt(
rule.conditionText.substring(startIndex, endIDRegion),
- 10
+ 10,
);
if (int !== id) {
@@ -202,14 +203,14 @@ if (typeof window !== "undefined") {
let startFileRegion = rule.conditionText.indexOf(
'(hmr-file:"',
- endIDRegion
+ endIDRegion,
);
if (startFileRegion === -1) return null;
startFileRegion += '(hmr-file:"'.length + 1;
const endFileRegion = rule.conditionText.indexOf(
'"',
- startFileRegion
+ startFileRegion,
);
if (endFileRegion === -1) return null;
// Empty file strings are invalid
@@ -220,7 +221,7 @@ if (typeof window !== "undefined") {
CSSLoader.cssLoadId.sheet = sheet;
CSSLoader.cssLoadId.file = rule.conditionText.substring(
startFileRegion - 1,
- endFileRegion
+ endFileRegion,
);
return CSSLoader.cssLoadId;
@@ -273,23 +274,23 @@ if (typeof window !== "undefined") {
const bundleIdEnd = bundleIdRule.conditionText.indexOf(
")",
- "(hmr-bid:".length + 1
+ "(hmr-bid:".length + 1,
);
if (bundleIdEnd === -1) continue;
CSSLoader.cssLoadId.bundle_id = parseInt(
bundleIdRule.conditionText.substring(
"(hmr-bid:".length,
- bundleIdEnd
+ bundleIdEnd,
),
- 10
+ 10,
);
for (let j = 1; j < ruleCount && match === null; j++) {
match = this.findMatchingSupportsRule(
cssRules[j] as CSSSupportsRule,
id,
- sheet
+ sheet,
);
}
}
@@ -326,20 +327,20 @@ if (typeof window !== "undefined") {
const bundleIdEnd = bundleIdRule.conditionText.indexOf(
")",
- "(hmr-bid:".length + 1
+ "(hmr-bid:".length + 1,
);
if (bundleIdEnd === -1) continue;
CSSLoader.cssLoadId.bundle_id = parseInt(
bundleIdRule.conditionText.substring("(hmr-bid:".length, bundleIdEnd),
- 10
+ 10,
);
for (let j = 1; j < ruleCount && match === null; j++) {
match = this.findMatchingSupportsRule(
cssRules[j] as CSSSupportsRule,
id,
- sheet
+ sheet,
);
}
}
@@ -358,7 +359,7 @@ if (typeof window !== "undefined") {
handleBuildSuccess(
bytes: Uint8Array,
build: API.WebsocketMessageBuildSuccess,
- timestamp: number
+ timestamp: number,
) {
const start = performance.now();
var update = this.findCSSLinkTag(build.id);
@@ -389,7 +390,7 @@ if (typeof window !== "undefined") {
"Reloaded in",
`${localDuration + fsDuration}ms`,
"-",
- filepath
+ filepath,
);
update = null;
@@ -445,7 +446,7 @@ if (typeof window !== "undefined") {
}
filePath(
- file_change_notification: API.WebsocketMessageFileChangeNotification
+ file_change_notification: API.WebsocketMessageFileChangeNotification,
): string | null {
if (file_change_notification.loader !== API.Loader.css) return null;
const tag = this.findCSSLinkTag(file_change_notification.id);
@@ -481,7 +482,7 @@ if (typeof window !== "undefined") {
start() {
if (runOnce) {
__hmrlog.warn(
- "Attempted to start HMR client multiple times. This may be a bug."
+ "Attempted to start HMR client multiple times. This may be a bug.",
);
return;
}
@@ -514,7 +515,7 @@ if (typeof window !== "undefined") {
this.nextReconnectAttempt = setTimeout(
this.attemptReconnect,
- this.reconnectDelay
+ this.reconnectDelay,
);
};
@@ -608,7 +609,7 @@ if (typeof window !== "undefined") {
case CSSImportState.Loaded: {
promise.then(
() => {},
- () => {}
+ () => {},
);
break;
}
@@ -672,19 +673,19 @@ if (typeof window !== "undefined") {
link.onerror = (evt) => {
console.error(
`[CSS Importer] Error loading CSS file: ${urlString}\n`,
- evt.toString()
+ evt.toString(),
);
reject();
};
document.head.appendChild(link);
- }).then(() => Promise.resolve())
+ }).then(() => Promise.resolve()),
);
}
static onError(event: ErrorEvent) {
if ("error" in event && !!event.error) {
BunError.render(
event.error,
- HMRClient.client ? HMRClient.client.cwd : ""
+ HMRClient.client ? HMRClient.client.cwd : "",
);
}
}
@@ -757,7 +758,7 @@ if (typeof window !== "undefined") {
BunError.render(failure, this.cwd);
console.group(
- `Build failed: ${failure.module_path} (${failure.log.errors} errors)`
+ `Build failed: ${failure.module_path} (${failure.log.errors} errors)`,
);
this.needsConsoleClear = true;
for (let msg of failure.log.msgs) {
@@ -823,7 +824,7 @@ if (typeof window !== "undefined") {
`Ignoring outdated update for "${build.module_path}".\n Expected: >=`,
currentVersion,
`\n Received:`,
- build.from_timestamp
+ build.from_timestamp,
);
}
return;
@@ -834,7 +835,7 @@ if (typeof window !== "undefined") {
? new Uint8Array(
buffer.data.buffer,
buffer.data.byteOffset + buffer.index,
- build.blob_length
+ build.blob_length,
)
: (empty ||= new Uint8Array(0));
@@ -876,7 +877,7 @@ if (typeof window !== "undefined") {
if (end > 4 && buffer.data.length >= end + 4) {
new Uint8Array(this.hashBuffer.buffer).set(
- buffer.data.subarray(end, end + 4)
+ buffer.data.subarray(end, end + 4),
);
hash = this.hashBuffer[0];
}
@@ -889,7 +890,7 @@ if (typeof window !== "undefined") {
build,
bytes,
ReloadBehavior.hotReload,
- hash || 0
+ hash || 0,
);
bytes = null;
reload.timings.notify = timestamp - build.from_timestamp;
@@ -911,7 +912,7 @@ if (typeof window !== "undefined") {
__hmrlog.log(
`[${formatDuration(timings.total)}ms] Reloaded`,
- filepath
+ filepath,
);
},
(err) => {
@@ -924,7 +925,7 @@ if (typeof window !== "undefined") {
}
__hmrlog.error("Hot Module Reload failed!", err);
debugger;
- }
+ },
);
}
@@ -942,7 +943,7 @@ if (typeof window !== "undefined") {
handleFileChangeNotification(
buffer: ByteBuffer,
timestamp: number,
- copy_file_path: boolean
+ copy_file_path: boolean,
) {
const notification =
API.decodeWebsocketMessageFileChangeNotification(buffer);
@@ -977,7 +978,7 @@ if (typeof window !== "undefined") {
timestamp,
notification,
file_path,
- copy_file_path
+ copy_file_path,
);
}
@@ -985,7 +986,7 @@ if (typeof window !== "undefined") {
timestamp: number,
notification: API.WebsocketMessageFileChangeNotification,
file_path: string,
- copy_file_path: boolean
+ copy_file_path: boolean,
) {
const accept = file_path && file_path.length > 0;
@@ -1072,10 +1073,10 @@ if (typeof window !== "undefined") {
const out = textEncoder.encodeInto(
file_path,
- writeBuffer.subarray(13)
+ writeBuffer.subarray(13),
);
this.socket.send(
- this.buildCommandBufWithFilePath.subarray(0, 13 + out.written)
+ this.buildCommandBufWithFilePath.subarray(0, 13 + out.written),
);
} else {
this.socket.send(this.buildCommandBuf);
@@ -1118,7 +1119,7 @@ if (typeof window !== "undefined") {
const message_header_byte_buffer = new ByteBuffer(data);
const header = API.decodeWebsocketMessage(message_header_byte_buffer);
const buffer = new ByteBuffer(
- data.subarray(message_header_byte_buffer.index)
+ data.subarray(message_header_byte_buffer.index),
);
switch (header.kind) {
@@ -1206,7 +1207,7 @@ if (typeof window !== "undefined") {
timestamp,
{ id, loader },
file_path,
- true
+ true,
);
break;
}
@@ -1233,7 +1234,7 @@ if (typeof window !== "undefined") {
__hmrlog.log(
"HMR connected in",
formatDuration(now - clientStartTime),
- "ms"
+ "ms",
);
break;
}
@@ -1241,7 +1242,7 @@ if (typeof window !== "undefined") {
__hmrlog.log(
"Live reload connected in",
formatDuration(now - clientStartTime),
- "ms"
+ "ms",
);
break;
}
@@ -1249,7 +1250,7 @@ if (typeof window !== "undefined") {
__hmrlog.log(
"Bun connected in",
formatDuration(now - clientStartTime),
- "ms"
+ "ms",
);
break;
}
@@ -1305,7 +1306,7 @@ if (typeof window !== "undefined") {
build: HotReload["build"],
bytes: Uint8Array,
reloader: ReloadBehavior,
- hash: number
+ hash: number,
) {
this.module_id = module_id;
this.module_index = module_index;
@@ -1362,7 +1363,7 @@ if (typeof window !== "undefined") {
try {
const blob = new Blob(
sourceMapURL.length > 0 ? [this.bytes, sourceMapURL] : [this.bytes],
- { type: "text/javascript" }
+ { type: "text/javascript" },
);
blobURL = URL.createObjectURL(blob);
HMRModule.dependencies.blobToID.set(blobURL, this.module_id);
@@ -1380,7 +1381,7 @@ if (typeof window !== "undefined") {
globalThis.__BunRenderHMRError(
exception,
oldModule.file_path,
- oldModule.id
+ oldModule.id,
);
}
@@ -1405,7 +1406,7 @@ if (typeof window !== "undefined") {
HMRModule.dependencies.modules[this.module_index].file_path,
"in",
formatDuration(this.timings.import),
- ". Running callbacks"
+ ". Running callbacks",
);
}
@@ -1453,7 +1454,7 @@ if (typeof window !== "undefined") {
const end = Math.min(
this.module_index + 1,
- HMRModule.dependencies.graph_used
+ HMRModule.dependencies.graph_used,
);
// -- For generic hot reloading --
// ES Modules delay execution until all imports are parsed
@@ -1516,8 +1517,8 @@ if (typeof window !== "undefined") {
} else {
return Promise.reject(
new ThrottleModuleUpdateError(
- `Expected pendingUpdateCount: ${currentPendingUpdateCount} but received: ${pendingUpdateCount}`
- )
+ `Expected pendingUpdateCount: ${currentPendingUpdateCount} but received: ${pendingUpdateCount}`,
+ ),
);
}
@@ -1538,7 +1539,7 @@ if (typeof window !== "undefined") {
HMRModule.dependencies.modules[this.module_index].file_path,
"in",
formatDuration(this.timings.callbacks),
- "ms"
+ "ms",
);
}
@@ -1625,7 +1626,7 @@ if (typeof window !== "undefined") {
// Grow the dependencies graph
if (HMRModule.dependencies.graph.length <= this.graph_index) {
const new_graph = new Uint32Array(
- HMRModule.dependencies.graph.length * 4
+ HMRModule.dependencies.graph.length * 4,
);
new_graph.set(HMRModule.dependencies.graph);
HMRModule.dependencies.graph = new_graph;
@@ -1730,7 +1731,7 @@ if (typeof window !== "undefined") {
$r_(Component: any, id: string) {
FastRefreshLoader.RefreshRuntime.register(
Component,
- this.refreshRuntimeBaseID + id
+ this.refreshRuntimeBaseID + id,
);
}
// $RefreshReg$(Component, Component.name || Component.displayName)
diff --git a/src/runtime/index-with-refresh.ts b/src/runtime/index-with-refresh.ts
index dc0c361f8..abea4c0f4 100644
--- a/src/runtime/index-with-refresh.ts
+++ b/src/runtime/index-with-refresh.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
export * from "./hmr";
export * from "./errors";
export * from "./index-without-hmr";
@@ -8,4 +9,4 @@ globalThis.process ||= {
cwd() {
return "/bun-fake-dir/";
},
-};
+} as any;
diff --git a/src/runtime/index-without-hmr.ts b/src/runtime/index-without-hmr.ts
index 858688130..5fcebbc28 100644
--- a/src/runtime/index-without-hmr.ts
+++ b/src/runtime/index-without-hmr.ts
@@ -1,2 +1,3 @@
+// @ts-nocheck
export * from "../runtime.js";
export { default as regeneratorRuntime } from "./regenerator";
diff --git a/src/runtime/index.ts b/src/runtime/index.ts
index 3eebc8d5b..3c35e361c 100644
--- a/src/runtime/index.ts
+++ b/src/runtime/index.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
export * from "./hmr";
export * from "./errors";
export * from "./index-without-hmr";
diff --git a/src/runtime/regenerator.ts b/src/runtime/regenerator.ts
index ca3780f44..0940fb9f1 100644
--- a/src/runtime/regenerator.ts
+++ b/src/runtime/regenerator.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
/**
* Copyright (c) 2014-present, Facebook, Inc.
*
@@ -113,7 +114,7 @@ var runtime = (function (exports) {
GeneratorFunction.displayName = define(
GeneratorFunctionPrototype,
toStringTagSymbol,
- "GeneratorFunction"
+ "GeneratorFunction",
);
// Helper for defining the .next, .throw, and .return methods of the
@@ -174,7 +175,7 @@ var runtime = (function (exports) {
},
function (err) {
invoke("throw", err, resolve, reject);
- }
+ },
);
}
@@ -190,7 +191,7 @@ var runtime = (function (exports) {
// If a rejected Promise was yielded, throw the rejection back
// into the async generator function so it can be handled there.
return invoke("throw", error, resolve, reject);
- }
+ },
);
}
}
@@ -222,7 +223,7 @@ var runtime = (function (exports) {
callInvokeWithMethodAndArg,
// Avoid propagating failures to Promises returned by later
// invocations of the iterator.
- callInvokeWithMethodAndArg
+ callInvokeWithMethodAndArg,
)
: callInvokeWithMethodAndArg());
}
@@ -246,7 +247,7 @@ var runtime = (function (exports) {
var iter = new AsyncIterator(
wrap(innerFn, outerFn, self, tryLocsList),
- PromiseImpl
+ PromiseImpl,
);
return exports.isGeneratorFunction(outerFn)
@@ -358,7 +359,7 @@ var runtime = (function (exports) {
context.method = "throw";
context.arg = new TypeError(
- "The iterator does not provide a 'throw' method"
+ "The iterator does not provide a 'throw' method",
);
}
@@ -741,7 +742,7 @@ var runtime = (function (exports) {
// as the regeneratorRuntime namespace. Otherwise create a new empty
// object. Either way, the resulting object will be used to initialize
// the regeneratorRuntime variable at the top of this file.
- typeof module === "object" ? module.exports : {}
+ typeof module === "object" ? module.exports : {},
);
try {
diff --git a/src/test/fixtures/browsermap-false.ts b/src/test/fixtures/browsermap-false.ts
index aac72e325..b4fc1ff32 100644
--- a/src/test/fixtures/browsermap-false.ts
+++ b/src/test/fixtures/browsermap-false.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
import { Foo } from "browsermap";
console.log(Foo);
diff --git a/src/test/fixtures/cannot-assign-to-import-bug.js b/src/test/fixtures/cannot-assign-to-import-bug.js
index c14b96541..ccf2c6194 100644
--- a/src/test/fixtures/cannot-assign-to-import-bug.js
+++ b/src/test/fixtures/cannot-assign-to-import-bug.js
@@ -283,7 +283,7 @@
"Instead, assign to `this.state` directly or define a `state = {};` " +
"class property with the desired state in the %s component.",
callerName,
- componentName
+ componentName,
);
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
@@ -341,7 +341,7 @@
publicInstance,
completeState,
callback,
- callerName
+ callerName,
) {
warnNoop(publicInstance, "replaceState");
},
@@ -362,7 +362,7 @@
publicInstance,
partialState,
callback,
- callerName
+ callerName,
) {
warnNoop(publicInstance, "setState");
},
@@ -424,7 +424,7 @@
) {
{
throw Error(
- "setState(...): takes an object of state variables to update or a function which returns an object of state variables."
+ "setState(...): takes an object of state variables to update or a function which returns an object of state variables.",
);
}
}
@@ -475,7 +475,7 @@
warn(
"%s(...) is deprecated in plain JavaScript React classes. %s",
info[0],
- info[1]
+ info[1],
);
return undefined;
@@ -549,7 +549,7 @@
if (typeof type.tag === "number") {
error(
"Received an unexpected object in getComponentName(). " +
- "This is likely a bug in React. Please file an issue."
+ "This is likely a bug in React. Please file an issue.",
);
}
}
@@ -672,7 +672,7 @@
"in `undefined` being returned. If you need to access the same " +
"value within the child component, you should pass it as a different " +
"prop. (https://reactjs.org/link/special-props)",
- displayName
+ displayName,
);
}
}
@@ -696,7 +696,7 @@
"in `undefined` being returned. If you need to access the same " +
"value within the child component, you should pass it as a different " +
"prop. (https://reactjs.org/link/special-props)",
- displayName
+ displayName,
);
}
}
@@ -728,7 +728,7 @@
"Learn more about using refs safely here: " +
"https://reactjs.org/link/strict-mode-string-ref",
componentName,
- config.ref
+ config.ref,
);
didWarnAboutStringRefs[componentName] = true;
@@ -905,7 +905,7 @@
self,
source,
ReactCurrentOwner.current,
- props
+ props,
);
}
function cloneAndReplaceKey(oldElement, newKey) {
@@ -916,7 +916,7 @@
oldElement._self,
oldElement._source,
oldElement._owner,
- oldElement.props
+ oldElement.props,
);
return newElement;
}
@@ -931,7 +931,7 @@
throw Error(
"React.cloneElement(...): The argument must be a React element, but you passed " +
element +
- "."
+ ".",
);
}
}
@@ -1125,7 +1125,7 @@
(mappedChild.key && (!_child || _child.key !== mappedChild.key) // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
? escapeUserProvidedKey("" + mappedChild.key) + "/"
: "") +
- childKey
+ childKey,
);
}
@@ -1151,7 +1151,7 @@
array,
escapedPrefix,
nextName,
- callback
+ callback,
);
}
} else {
@@ -1166,7 +1166,7 @@
if (!didWarnAboutMaps) {
warn(
"Using Maps as children is not supported. " +
- "Use an array of keyed ReactElements instead."
+ "Use an array of keyed ReactElements instead.",
);
}
@@ -1186,7 +1186,7 @@
array,
escapedPrefix,
nextName,
- callback
+ callback,
);
}
} else if (type === "object") {
@@ -1201,7 +1201,7 @@
Object.keys(children).join(", ") +
"}"
: childrenString) +
- "). If you meant to render a collection of children, use an array instead."
+ "). If you meant to render a collection of children, use an array instead.",
);
}
}
@@ -1272,7 +1272,7 @@
function () {
forEachFunc.apply(this, arguments); // Don't return anything.
},
- forEachContext
+ forEachContext,
);
}
/**
@@ -1308,7 +1308,7 @@
if (!isValidElement(children)) {
{
throw Error(
- "React.Children.only expected to receive a single React element child."
+ "React.Children.only expected to receive a single React element child.",
);
}
}
@@ -1328,7 +1328,7 @@
error(
"createContext: Expected the optional second argument to be a " +
"function. Instead received: %s",
- calculateChangedBits
+ calculateChangedBits,
);
}
}
@@ -1377,7 +1377,7 @@
error(
"Rendering <Context.Consumer.Provider> is not supported and will be removed in " +
- "a future major release. Did you mean to render <Context.Provider> instead?"
+ "a future major release. Did you mean to render <Context.Provider> instead?",
);
}
@@ -1418,7 +1418,7 @@
error(
"Rendering <Context.Consumer.Consumer> is not supported and will be removed in " +
- "a future major release. Did you mean to render <Context.Consumer> instead?"
+ "a future major release. Did you mean to render <Context.Consumer> instead?",
);
}
@@ -1434,7 +1434,7 @@
warn(
"Setting `displayName` on Context.Consumer has no effect. " +
"You should set it directly on the context with Context.displayName = '%s'.",
- displayName
+ displayName,
);
hasWarnedAboutDisplayNameOnConsumer = true;
@@ -1479,7 +1479,7 @@
"Instead received: %s\n\nYour code should look like: \n " + // Break up imports to avoid accidentally parsing them as dependencies.
"const MyComponent = lazy(() => imp" +
"ort('./MyComponent'))",
- moduleObject
+ moduleObject,
);
}
} // Transition to the next state.
@@ -1496,7 +1496,7 @@
rejected._status = Rejected;
rejected._result = error;
}
- }
+ },
);
}
@@ -1534,7 +1534,7 @@
error(
"React.lazy(...): It is not supported to assign `defaultProps` to " +
"a lazy component import. Either specify them where the component " +
- "is defined, or create a wrapping component around it."
+ "is defined, or create a wrapping component around it.",
);
defaultProps = newDefaultProps; // Match production behavior more closely:
@@ -1554,7 +1554,7 @@
error(
"React.lazy(...): It is not supported to assign `propTypes` to " +
"a lazy component import. Either specify them where the component " +
- "is defined, or create a wrapping component around it."
+ "is defined, or create a wrapping component around it.",
);
propTypes = newPropTypes; // Match production behavior more closely:
@@ -1577,12 +1577,12 @@
error(
"forwardRef requires a render function but received a `memo` " +
"component. Instead of forwardRef(memo(...)), use " +
- "memo(forwardRef(...))."
+ "memo(forwardRef(...)).",
);
} else if (typeof render !== "function") {
error(
"forwardRef requires a render function but was given %s.",
- render === null ? "null" : typeof render
+ render === null ? "null" : typeof render,
);
} else {
if (render.length !== 0 && render.length !== 2) {
@@ -1590,7 +1590,7 @@
"forwardRef render functions accept exactly two parameters: props and ref. %s",
render.length === 1
? "Did you forget to use the ref parameter?"
- : "Any additional parameter will be undefined."
+ : "Any additional parameter will be undefined.",
);
}
}
@@ -1599,7 +1599,7 @@
if (render.defaultProps != null || render.propTypes != null) {
error(
"forwardRef render functions do not support propTypes or defaultProps. " +
- "Did you accidentally pass a React component?"
+ "Did you accidentally pass a React component?",
);
}
}
@@ -1677,7 +1677,7 @@
error(
"memo: The first argument must be a component. Instead " +
"received: %s",
- type === null ? "null" : typeof type
+ type === null ? "null" : typeof type,
);
}
}
@@ -1715,7 +1715,7 @@
if (!(dispatcher !== null)) {
{
throw Error(
- "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.",
);
}
}
@@ -1738,7 +1738,7 @@
? "\n\nDid you call array.map(useContext)? " +
"Calling Hooks inside a loop is not supported. " +
"Learn more at https://reactjs.org/link/rules-of-hooks"
- : ""
+ : "",
);
} // TODO: add a more generic warning for invalid values.
@@ -1749,12 +1749,12 @@
if (realContext.Consumer === Context) {
error(
"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be " +
- "removed in a future major release. Did you mean to call useContext(Context) instead?"
+ "removed in a future major release. Did you mean to call useContext(Context) instead?",
);
} else if (realContext.Provider === Context) {
error(
"Calling useContext(Context.Provider) is not supported. " +
- "Did you mean to call useContext(Context) instead?"
+ "Did you mean to call useContext(Context) instead?",
);
}
}
@@ -1892,7 +1892,7 @@
if (disabledDepth < 0) {
error(
"disabledDepth fell below zero. " +
- "This is a bug in React. Please file an issue."
+ "This is a bug in React. Please file an issue.",
);
}
}
@@ -2117,7 +2117,7 @@
return describeUnknownElementTypeFrameInDEV(
type.type,
source,
- ownerFn
+ ownerFn,
);
case REACT_BLOCK_TYPE:
@@ -2133,7 +2133,7 @@
return describeUnknownElementTypeFrameInDEV(
init(payload),
source,
- ownerFn
+ ownerFn,
);
} catch (x) {}
}
@@ -2153,7 +2153,7 @@
var stack = describeUnknownElementTypeFrameInDEV(
element.type,
element._source,
- owner ? owner.type : null
+ owner ? owner.type : null,
);
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
} else {
@@ -2187,7 +2187,7 @@
"it must be a function, usually from the `prop-types` package, but received `" +
typeof typeSpecs[typeSpecName] +
"`." +
- "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
+ "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.",
);
err.name = "Invariant Violation";
throw err;
@@ -2199,7 +2199,7 @@
componentName,
location,
null,
- "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"
+ "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",
);
} catch (ex) {
error$1 = ex;
@@ -2218,7 +2218,7 @@
componentName || "React class",
location,
typeSpecName,
- typeof error$1
+ typeof error$1,
);
setCurrentlyValidatingElement(null);
@@ -2249,7 +2249,7 @@
var stack = describeUnknownElementTypeFrameInDEV(
element.type,
element._source,
- owner ? owner.type : null
+ owner ? owner.type : null,
);
setExtraStackFrame(stack);
} else {
@@ -2367,7 +2367,7 @@
'Each child in a list should have a unique "key" prop.' +
"%s%s See https://reactjs.org/link/warning-keys for more information.",
currentComponentErrorInfo,
- childOwner
+ childOwner,
);
setCurrentlyValidatingElement$1(null);
@@ -2464,7 +2464,7 @@
error(
"Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",
- _name || "Unknown"
+ _name || "Unknown",
);
}
@@ -2474,7 +2474,7 @@
) {
error(
"getDefaultProps is only used on classic React.createClass " +
- "definitions. Use a static property named `defaultProps` instead."
+ "definitions. Use a static property named `defaultProps` instead.",
);
}
}
@@ -2497,7 +2497,7 @@
error(
"Invalid prop `%s` supplied to `React.Fragment`. " +
"React.Fragment can only have `key` and `children` props.",
- key
+ key,
);
setCurrentlyValidatingElement$1(null);
@@ -2560,7 +2560,7 @@
"built-in components) or a class/function (for composite " +
"components) but got: %s.%s",
typeString,
- info
+ info,
);
}
}
@@ -2602,7 +2602,7 @@
warn(
"React.createFactory() is deprecated and will be removed in " +
"a future major release. Consider using JSX " +
- "or use React.createElement() directly instead."
+ "or use React.createElement() directly instead.",
);
} // Legacy hook: remove it
@@ -2611,7 +2611,7 @@
get: function () {
warn(
"Factory.type is deprecated. Access the class directly " +
- "before passing it to createFactory."
+ "before passing it to createFactory.",
);
Object.defineProperty(this, "type", {
@@ -2730,7 +2730,7 @@
console["error"](
"This browser doesn't support requestAnimationFrame. " +
"Make sure that you load a " +
- "polyfill in older browsers. https://reactjs.org/link/react-polyfills"
+ "polyfill in older browsers. https://reactjs.org/link/react-polyfills",
);
}
@@ -2739,7 +2739,7 @@
console["error"](
"This browser doesn't support cancelAnimationFrame. " +
"Make sure that you load a " +
- "polyfill in older browsers. https://reactjs.org/link/react-polyfills"
+ "polyfill in older browsers. https://reactjs.org/link/react-polyfills",
);
}
}
@@ -2769,7 +2769,7 @@
// Using console['error'] to evade Babel and ESLint
console["error"](
"forceFrameRate takes a positive int between 0 and 125, " +
- "forcing frame rates higher than 125 fps is not supported"
+ "forcing frame rates higher than 125 fps is not supported",
);
return;
}
@@ -2794,7 +2794,7 @@
try {
var hasMoreWork = scheduledHostCallback(
hasTimeRemaining,
- currentTime
+ currentTime,
);
if (!hasMoreWork) {
diff --git a/src/test/fixtures/class-with-property.ts b/src/test/fixtures/class-with-property.ts
index 9c9aee2d4..9d555fa2f 100644
--- a/src/test/fixtures/class-with-property.ts
+++ b/src/test/fixtures/class-with-property.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
class Foo {
prop: string;
}
diff --git a/src/test/fixtures/default_export_hmr_identifier_ref.tsx b/src/test/fixtures/default_export_hmr_identifier_ref.tsx
index 4c742c6ef..a6a961532 100644
--- a/src/test/fixtures/default_export_hmr_identifier_ref.tsx
+++ b/src/test/fixtures/default_export_hmr_identifier_ref.tsx
@@ -1,3 +1,4 @@
+// @ts-nocheck
const Button = forwardRef<HTMLButtonElement, Props>(({}, ref) => {});
Button.displayName = "Button";
diff --git a/src/test/fixtures/exports-bug.js b/src/test/fixtures/exports-bug.js
index 081b8cfa0..66574686a 100644
--- a/src/test/fixtures/exports-bug.js
+++ b/src/test/fixtures/exports-bug.js
@@ -213,7 +213,7 @@ function WebGLRenderer(parameters) {
if (_gl === null) {
if (_canvas.getContext("webgl") !== null) {
throw new Error(
- "Error creating WebGL context with your selected attributes."
+ "Error creating WebGL context with your selected attributes.",
);
} else {
throw new Error("Error creating WebGL context.");
@@ -261,10 +261,10 @@ function WebGLRenderer(parameters) {
state = new WebGLState(_gl, extensions, utils, capabilities);
state.scissor(
- _currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor()
+ _currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor(),
);
state.viewport(
- _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor()
+ _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor(),
);
info = new WebGLInfo(_gl);
@@ -276,7 +276,7 @@ function WebGLRenderer(parameters) {
properties,
capabilities,
utils,
- info
+ info,
);
attributes = new WebGLAttributes(_gl);
geometries = new WebGLGeometries(_gl, attributes, info);
@@ -290,20 +290,20 @@ function WebGLRenderer(parameters) {
_this,
state,
objects,
- _premultipliedAlpha
+ _premultipliedAlpha,
);
bufferRenderer = new WebGLBufferRenderer(
_gl,
extensions,
info,
- capabilities
+ capabilities,
);
indexedBufferRenderer = new WebGLIndexedBufferRenderer(
_gl,
extensions,
info,
- capabilities
+ capabilities,
);
info.programs = programCache.programs;
@@ -334,7 +334,7 @@ function WebGLRenderer(parameters) {
var shadowMap = new WebGLShadowMap(
_this,
objects,
- capabilities.maxTextureSize
+ capabilities.maxTextureSize,
);
this.shadowMap = shadowMap;
@@ -374,7 +374,7 @@ function WebGLRenderer(parameters) {
this.getSize = function (target) {
if (target === undefined) {
console.warn(
- "WebGLRenderer: .getsize() now requires a Vector2 as an argument"
+ "WebGLRenderer: .getsize() now requires a Vector2 as an argument",
);
target = new Vector2();
@@ -386,7 +386,7 @@ function WebGLRenderer(parameters) {
this.setSize = function (width, height, updateStyle) {
if (vr.isPresenting()) {
console.warn(
- "THREE.WebGLRenderer: Can't change size while VR device is presenting."
+ "THREE.WebGLRenderer: Can't change size while VR device is presenting.",
);
return;
}
@@ -408,7 +408,7 @@ function WebGLRenderer(parameters) {
this.getDrawingBufferSize = function (target) {
if (target === undefined) {
console.warn(
- "WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"
+ "WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument",
);
target = new Vector2();
@@ -432,7 +432,7 @@ function WebGLRenderer(parameters) {
this.getCurrentViewport = function (target) {
if (target === undefined) {
console.warn(
- "WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"
+ "WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument",
);
target = new Vector4();
@@ -453,7 +453,7 @@ function WebGLRenderer(parameters) {
}
state.viewport(
- _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor()
+ _currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor(),
);
};
@@ -469,7 +469,7 @@ function WebGLRenderer(parameters) {
}
state.scissor(
- _currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor()
+ _currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor(),
);
};
@@ -528,7 +528,7 @@ function WebGLRenderer(parameters) {
_canvas.removeEventListener(
"webglcontextrestored",
onContextRestore,
- false
+ false,
);
renderLists.dispose();
@@ -618,7 +618,7 @@ function WebGLRenderer(parameters) {
_gl.FLOAT,
false,
0,
- 0
+ 0,
);
}
@@ -633,7 +633,7 @@ function WebGLRenderer(parameters) {
_gl.FLOAT,
false,
0,
- 0
+ 0,
);
}
@@ -656,7 +656,7 @@ function WebGLRenderer(parameters) {
_gl.FLOAT,
false,
0,
- 0
+ 0,
);
}
@@ -673,7 +673,7 @@ function WebGLRenderer(parameters) {
geometry,
material,
object,
- group
+ group,
) {
var frontFaceCW = object.isMesh && object.matrixWorld.determinant() < 0;
@@ -811,7 +811,7 @@ function WebGLRenderer(parameters) {
) {
if (extensions.get("ANGLE_instanced_arrays") === null) {
console.error(
- "THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays."
+ "THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.",
);
return;
}
@@ -853,7 +853,7 @@ function WebGLRenderer(parameters) {
if (data && data.isInstancedInterleavedBuffer) {
state.enableAttributeAndDivisor(
programAttribute,
- data.meshPerAttribute
+ data.meshPerAttribute,
);
if (geometry.maxInstancedCount === undefined) {
@@ -870,13 +870,13 @@ function WebGLRenderer(parameters) {
type,
normalized,
stride * bytesPerElement,
- offset * bytesPerElement
+ offset * bytesPerElement,
);
} else {
if (geometryAttribute.isInstancedBufferAttribute) {
state.enableAttributeAndDivisor(
programAttribute,
- geometryAttribute.meshPerAttribute
+ geometryAttribute.meshPerAttribute,
);
if (geometry.maxInstancedCount === undefined) {
@@ -894,7 +894,7 @@ function WebGLRenderer(parameters) {
type,
normalized,
0,
- 0
+ 0,
);
}
} else if (materialDefaultAttributeValues !== undefined) {
@@ -984,21 +984,21 @@ function WebGLRenderer(parameters) {
if (arguments[2] !== undefined) {
console.warn(
- "THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."
+ "THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead.",
);
renderTarget = arguments[2];
}
if (arguments[3] !== undefined) {
console.warn(
- "THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."
+ "THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead.",
);
forceClear = arguments[3];
}
if (!(camera && camera.isCamera)) {
console.error(
- "THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera."
+ "THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.",
);
return;
}
@@ -1034,12 +1034,12 @@ function WebGLRenderer(parameters) {
_this,
scene,
camera,
- renderTarget || _currentRenderTarget
+ renderTarget || _currentRenderTarget,
);
_projScreenMatrix.multiplyMatrices(
camera.projectionMatrix,
- camera.matrixWorldInverse
+ camera.matrixWorldInverse,
);
_frustum.setFromMatrix(_projScreenMatrix);
@@ -1047,7 +1047,7 @@ function WebGLRenderer(parameters) {
_clippingEnabled = _clipping.init(
this.clippingPlanes,
_localClippingEnabled,
- camera
+ camera,
);
currentRenderList = renderLists.get(scene, camera);
@@ -1174,7 +1174,7 @@ function WebGLRenderer(parameters) {
material,
groupOrder,
_vector3.z,
- null
+ null,
);
}
}
@@ -1191,7 +1191,7 @@ function WebGLRenderer(parameters) {
object.material,
groupOrder,
_vector3.z,
- null
+ null,
);
} else if (object.isMesh || object.isLine || object.isPoints) {
if (object.isSkinnedMesh) {
@@ -1222,7 +1222,7 @@ function WebGLRenderer(parameters) {
groupMaterial,
groupOrder,
_vector3.z,
- group
+ group,
);
}
}
@@ -1233,7 +1233,7 @@ function WebGLRenderer(parameters) {
material,
groupOrder,
_vector3.z,
- null
+ null,
);
}
}
@@ -1287,7 +1287,7 @@ function WebGLRenderer(parameters) {
object.modelViewMatrix.multiplyMatrices(
camera.matrixWorldInverse,
- object.matrixWorld
+ object.matrixWorld,
);
object.normalMatrix.getNormalMatrix(object.modelViewMatrix);
@@ -1308,7 +1308,7 @@ function WebGLRenderer(parameters) {
geometry,
material,
object,
- group
+ group,
);
}
@@ -1331,7 +1331,7 @@ function WebGLRenderer(parameters) {
fog,
_clipping.numPlanes,
_clipping.numIntersection,
- object
+ object,
);
var code = programCache.getProgramCode(material, parameters);
@@ -1385,7 +1385,7 @@ function WebGLRenderer(parameters) {
material,
materialProperties.shader,
parameters,
- code
+ code,
);
materialProperties.program = program;
@@ -1478,7 +1478,7 @@ function WebGLRenderer(parameters) {
material.clipShadows,
camera,
materialProperties,
- useCache
+ useCache,
);
}
}
@@ -1534,7 +1534,7 @@ function WebGLRenderer(parameters) {
p_uniforms.setValue(
_gl,
"logDepthBufFC",
- 2.0 / (Math.log(camera.far + 1.0) / Math.LN2)
+ 2.0 / (Math.log(camera.far + 1.0) / Math.LN2),
);
}
@@ -1563,7 +1563,7 @@ function WebGLRenderer(parameters) {
if (uCamPos !== undefined) {
uCamPos.setValue(
_gl,
- _vector3.setFromMatrixPosition(camera.matrixWorld)
+ _vector3.setFromMatrixPosition(camera.matrixWorld),
);
}
}
@@ -1614,7 +1614,7 @@ function WebGLRenderer(parameters) {
size,
size,
RGBAFormat,
- FloatType
+ FloatType,
);
boneTexture.needsUpdate = true;
@@ -1627,7 +1627,7 @@ function WebGLRenderer(parameters) {
_gl,
"boneTexture",
skeleton.boneTexture,
- textures
+ textures,
);
p_uniforms.setValue(_gl, "boneTextureSize", skeleton.boneTextureSize);
} else {
@@ -1640,12 +1640,12 @@ function WebGLRenderer(parameters) {
p_uniforms.setValue(
_gl,
"toneMappingExposure",
- _this.toneMappingExposure
+ _this.toneMappingExposure,
);
p_uniforms.setValue(
_gl,
"toneMappingWhitePoint",
- _this.toneMappingWhitePoint
+ _this.toneMappingWhitePoint,
);
if (material.lights) {
@@ -1728,7 +1728,7 @@ function WebGLRenderer(parameters) {
_gl,
materialProperties.uniformsList,
m_uniforms,
- textures
+ textures,
);
}
@@ -1737,7 +1737,7 @@ function WebGLRenderer(parameters) {
_gl,
materialProperties.uniformsList,
m_uniforms,
- textures
+ textures,
);
material.uniformsNeedUpdate = false;
}
@@ -1795,7 +1795,7 @@ function WebGLRenderer(parameters) {
uniforms.refractionRatio.value = material.refractionRatio;
uniforms.maxMipLevel.value = properties.get(
- material.envMap
+ material.envMap,
).__maxMipLevel;
}
@@ -2108,7 +2108,7 @@ function WebGLRenderer(parameters) {
this.setRenderTarget = function (
renderTarget,
activeCubeFace,
- activeMipmapLevel
+ activeMipmapLevel,
) {
_currentRenderTarget = renderTarget;
_currentActiveCubeFace = activeCubeFace;
@@ -2162,7 +2162,7 @@ function WebGLRenderer(parameters) {
_gl.COLOR_ATTACHMENT0,
_gl.TEXTURE_CUBE_MAP_POSITIVE_X + (activeCubeFace || 0),
textureProperties.__webglTexture,
- activeMipmapLevel || 0
+ activeMipmapLevel || 0,
);
}
};
@@ -2174,11 +2174,11 @@ function WebGLRenderer(parameters) {
width,
height,
buffer,
- activeCubeFaceIndex
+ activeCubeFaceIndex,
) {
if (!(renderTarget && renderTarget.isWebGLRenderTarget)) {
console.error(
- "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget."
+ "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.",
);
return;
}
@@ -2212,7 +2212,7 @@ function WebGLRenderer(parameters) {
_gl.getParameter(_gl.IMPLEMENTATION_COLOR_READ_FORMAT)
) {
console.error(
- "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format."
+ "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.",
);
return;
}
@@ -2235,7 +2235,7 @@ function WebGLRenderer(parameters) {
)
) {
console.error(
- "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type."
+ "THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.",
);
return;
}
@@ -2259,12 +2259,12 @@ function WebGLRenderer(parameters) {
height,
utils.convert(textureFormat),
utils.convert(textureType),
- buffer
+ buffer,
);
}
} else {
console.error(
- "THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."
+ "THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.",
);
}
} finally {
@@ -2290,7 +2290,7 @@ function WebGLRenderer(parameters) {
position.y,
width,
height,
- 0
+ 0,
);
};
@@ -2298,7 +2298,7 @@ function WebGLRenderer(parameters) {
position,
srcTexture,
dstTexture,
- level
+ level,
) {
var width = srcTexture.image.width;
var height = srcTexture.image.height;
@@ -2317,7 +2317,7 @@ function WebGLRenderer(parameters) {
height,
glFormat,
glType,
- srcTexture.image.data
+ srcTexture.image.data,
);
} else {
_gl.texSubImage2D(
@@ -2327,14 +2327,14 @@ function WebGLRenderer(parameters) {
position.y,
glFormat,
glType,
- srcTexture.image
+ srcTexture.image,
);
}
};
if (typeof __THREE_DEVTOOLS__ !== "undefined") {
__THREE_DEVTOOLS__.dispatchEvent(
- new CustomEvent("observe", { detail: this })
+ new CustomEvent("observe", { detail: this }),
); // eslint-disable-line no-undef
}
}
diff --git a/src/test/fixtures/json-parser-in-typescript.js b/src/test/fixtures/json-parser-in-typescript.js
index b81b6d820..51636bfee 100644
--- a/src/test/fixtures/json-parser-in-typescript.js
+++ b/src/test/fixtures/json-parser-in-typescript.js
@@ -3,5 +3,4 @@
// } & {
// "twitter": "https://twitter.com/buildsghost"
// }
-export default class Foo {
-}
+export default class Foo {}
diff --git a/src/test/fixtures/json-parser-in-typescript.ts b/src/test/fixtures/json-parser-in-typescript.ts
index 8987a5f7f..6b0f9ccc2 100644
--- a/src/test/fixtures/json-parser-in-typescript.ts
+++ b/src/test/fixtures/json-parser-in-typescript.ts
@@ -7,11 +7,11 @@ type EatWhitespace<State extends string> = string extends State
type AddKeyValue<
Memo extends Record<string, any>,
Key extends string,
- Value extends any
+ Value extends any,
> = Memo & { [K in Key]: Value };
type ParseJsonObject<
State extends string,
- Memo extends Record<string, any> = {}
+ Memo extends Record<string, any> = {},
> = string extends State
? ParserError<"ParseJsonObject got generic string type">
: EatWhitespace<State> extends `}${infer State}`
@@ -27,18 +27,20 @@ type ParseJsonObject<
: ParserError<`ParseJsonValue returned unexpected value for: ${State}`>
: ParserError<`ParseJsonObject received unexpected token: ${State}`>
: ParserError<`ParseJsonObject received unexpected token: ${State}`>;
-type ParseJsonArray<State extends string, Memo extends any[] = []> =
- string extends State
- ? ParserError<"ParseJsonArray got generic string type">
+type ParseJsonArray<
+ State extends string,
+ Memo extends any[] = [],
+> = string extends State
+ ? ParserError<"ParseJsonArray got generic string type">
+ : EatWhitespace<State> extends `]${infer State}`
+ ? [Memo, State]
+ : ParseJsonValue<State> extends [infer Value, `${infer State}`]
+ ? EatWhitespace<State> extends `,${infer State}`
+ ? ParseJsonArray<EatWhitespace<State>, [...Memo, Value]>
: EatWhitespace<State> extends `]${infer State}`
- ? [Memo, State]
- : ParseJsonValue<State> extends [infer Value, `${infer State}`]
- ? EatWhitespace<State> extends `,${infer State}`
- ? ParseJsonArray<EatWhitespace<State>, [...Memo, Value]>
- : EatWhitespace<State> extends `]${infer State}`
- ? [[...Memo, Value], State]
- : ParserError<`ParseJsonArray received unexpected token: ${State}`>
- : ParserError<`ParseJsonValue returned unexpected value for: ${State}`>;
+ ? [[...Memo, Value], State]
+ : ParserError<`ParseJsonArray received unexpected token: ${State}`>
+ : ParserError<`ParseJsonValue returned unexpected value for: ${State}`>;
type ParseJsonValue<State extends string> = string extends State
? ParserError<"ParseJsonValue got generic string type">
: EatWhitespace<State> extends `null${infer State}`
diff --git a/src/test/fixtures/main-field.ts b/src/test/fixtures/main-field.ts
index 5f69721c8..ad159b518 100644
--- a/src/test/fixtures/main-field.ts
+++ b/src/test/fixtures/main-field.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
import Algolia from "algoliasearch/lite";
console.log(Algolia);
diff --git a/src/test/fixtures/namespaced-validators.ts b/src/test/fixtures/namespaced-validators.ts
index fcafcb139..ec070e8ec 100644
--- a/src/test/fixtures/namespaced-validators.ts
+++ b/src/test/fixtures/namespaced-validators.ts
@@ -65,7 +65,7 @@ for (let s of strings) {
console.log(
`"${s}" - ${
validators[name].isAcceptable(s) ? "matches" : "does not match"
- } ${name}`
+ } ${name}`,
);
}
}
diff --git a/src/test/fixtures/out.esbuild.js b/src/test/fixtures/out.esbuild.js
index 8afef3006..1ebec8919 100644
--- a/src/test/fixtures/out.esbuild.js
+++ b/src/test/fixtures/out.esbuild.js
@@ -1,2 +1 @@
-(() => {
-})();
+(() => {})();
diff --git a/src/test/fixtures/simple-150x.jsx b/src/test/fixtures/simple-150x.jsx
index 385d28bab..64cb88b1b 100644
--- a/src/test/fixtures/simple-150x.jsx
+++ b/src/test/fixtures/simple-150x.jsx
@@ -121,7 +121,7 @@ import { SPACING } from "../helpers/styles";
evt.preventDefault();
Router.pushRoute(
- `/sign-up/verify?${qs.stringify({ email: this.state.email })}`
+ `/sign-up/verify?${qs.stringify({ email: this.state.email })}`,
);
};
@@ -439,6 +439,6 @@ import { SPACING } from "../helpers/styles";
}
const HomepageWithStore = withRedux(initStore, null, (dispatch) =>
- bindActionCreators({ updateEntities, setCurrentUser }, dispatch)
+ bindActionCreators({ updateEntities, setCurrentUser }, dispatch),
)(LoginGate(Homepage));
})();
diff --git a/src/test/fixtures/simple.jsx b/src/test/fixtures/simple.jsx
index 5ece00d59..63873fe8d 100644
--- a/src/test/fixtures/simple.jsx
+++ b/src/test/fixtures/simple.jsx
@@ -119,7 +119,7 @@ class SignupForm extends React.Component {
evt.preventDefault();
Router.pushRoute(
- `/sign-up/verify?${qs.stringify({ email: this.state.email })}`
+ `/sign-up/verify?${qs.stringify({ email: this.state.email })}`,
);
};
@@ -429,7 +429,7 @@ class Homepage extends React.Component {
}
const HomepageWithStore = withRedux(initStore, null, (dispatch) =>
- bindActionCreators({ updateEntities, setCurrentUser }, dispatch)
+ bindActionCreators({ updateEntities, setCurrentUser }, dispatch),
)(LoginGate(Homepage));
export default HomepageWithStore;
diff --git a/src/test/fixtures/tsconfig.json b/src/test/fixtures/tsconfig.json
index 04a8d8eb9..5bf130a29 100644
--- a/src/test/fixtures/tsconfig.json
+++ b/src/test/fixtures/tsconfig.json
@@ -1,9 +1,13 @@
{
"compilerOptions": {
"baseUrl": "/Users/jarredsumner/Code/bun/src/test/fixtures",
+ "strict": true,
+ "noImplicitAny": false,
"paths": {
- "components/*": ["components/*"]
+ "components/*": [
+ "components/*"
+ ]
},
"jsx": "preserve",
}
-}
+} \ No newline at end of file
diff --git a/src/test/fixtures/type-only-import.ts b/src/test/fixtures/type-only-import.ts
index af7c11a12..8ae8fda13 100644
--- a/src/test/fixtures/type-only-import.ts
+++ b/src/test/fixtures/type-only-import.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
import { Foo } from "bacon";
import React from "react";
import * as Boom from "react";
@@ -5,7 +6,7 @@ import { createElement } from "react";
export const hello: Foo = React.createElement("div");
export const bacon: (foo: (what: Foo) => (the: Foo) => Foo) => Foo = (
- foo: Foo
+ foo: Foo,
) => {
return createElement(true);
};
diff --git a/src/test/fixtures/typescript-is-turing-complete.ts b/src/test/fixtures/typescript-is-turing-complete.ts
index 11f9d5be0..5abd46b73 100644
--- a/src/test/fixtures/typescript-is-turing-complete.ts
+++ b/src/test/fixtures/typescript-is-turing-complete.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
type StringBool = "true" | "false";
interface AnyNumber {
@@ -33,7 +34,7 @@ type Subt<T1 extends AnyNumber, T2 extends AnyNumber> = {
interface SubtResult<
TIsOverflow extends StringBool,
- TResult extends AnyNumber
+ TResult extends AnyNumber,
> {
isOverflowing: TIsOverflow;
result: TResult;
@@ -95,7 +96,7 @@ type Mod<TNumber extends AnyNumber, TModNumber extends AnyNumber> = {
type Mod2<
TNumber extends AnyNumber,
TModNumber extends AnyNumber,
- TSubtResult extends SubtResult<any, any>
+ TSubtResult extends SubtResult<any, any>,
> = {
true: TNumber;
false: Mod<TSubtResult["result"], TModNumber>;
@@ -109,7 +110,7 @@ type Equals<TNumber1 extends AnyNumber, TNumber2 extends AnyNumber> = Equals2<
type Equals2<
TNumber1 extends AnyNumber,
TNumber2 extends AnyNumber,
- TSubtResult extends SubtResult<any, any>
+ TSubtResult extends SubtResult<any, any>,
> = {
true: "false";
false: IsZero<TSubtResult["result"]>;