aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js
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 /test/bun.js
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 'test/bun.js')
-rw-r--r--test/bun.js/arraybuffersink.test.ts17
-rw-r--r--test/bun.js/bigint.test.js12
-rw-r--r--test/bun.js/body-mixin-errors.test.ts2
-rw-r--r--test/bun.js/body-stream.test.ts90
-rw-r--r--test/bun.js/buffer.test.js26
-rw-r--r--test/bun.js/bun-write.test.js30
-rw-r--r--test/bun.js/bundled/tsconfig.json4
-rw-r--r--test/bun.js/child_process-node.test.js46
-rw-r--r--test/bun.js/child_process.test.ts21
-rw-r--r--test/bun.js/concat.test.js6
-rw-r--r--test/bun.js/console-log.js6
-rw-r--r--test/bun.js/decorators.test.ts5
-rw-r--r--test/bun.js/escapeHTML.test.js38
-rw-r--r--test/bun.js/event-emitter.test.ts1
-rw-r--r--test/bun.js/fetch.test.js28
-rw-r--r--test/bun.js/ffi.test.fixture.callback.c3
-rw-r--r--test/bun.js/ffi.test.js36
-rw-r--r--test/bun.js/fileUrl.test.js4
-rw-r--r--test/bun.js/filesink.test.ts12
-rw-r--r--test/bun.js/fs-stream.js2
-rw-r--r--test/bun.js/fs.test.js36
-rw-r--r--test/bun.js/html-rewriter.test.js42
-rw-r--r--test/bun.js/import-meta.test.js4
-rw-r--r--test/bun.js/inspect.test.js40
-rw-r--r--test/bun.js/log-test.test.ts4
-rw-r--r--test/bun.js/microtask.test.js4
-rw-r--r--test/bun.js/node-test-helpers.test.js2
-rw-r--r--test/bun.js/oniguruma-regexp.test.ts227
-rw-r--r--test/bun.js/os.test.js10
-rw-r--r--test/bun.js/path.test.js20
-rw-r--r--test/bun.js/peek.test.ts11
-rw-r--r--test/bun.js/performance.test.js2
-rw-r--r--test/bun.js/plugins.d.ts11
-rw-r--r--test/bun.js/plugins.test.ts24
-rw-r--r--test/bun.js/print-process-args.js4
-rw-r--r--test/bun.js/process-args.test.js56
-rw-r--r--test/bun.js/process-nexttick.js6
-rw-r--r--test/bun.js/process-nexttick.test.js6
-rw-r--r--test/bun.js/process.test.js4
-rw-r--r--test/bun.js/react-dom-server.bun.cjs3122
-rw-r--r--test/bun.js/react-dom.test.tsx20
-rw-r--r--test/bun.js/resolve-error.test.ts2
-rw-r--r--test/bun.js/resolve.test.js58
-rw-r--r--test/bun.js/serve.test.ts28
-rw-r--r--test/bun.js/snapshots.debug.js9
-rw-r--r--test/bun.js/snapshots.js9
-rw-r--r--test/bun.js/solid-dom-fixtures/SVG/code.js2
-rw-r--r--test/bun.js/solid-dom-fixtures/attributeExpressions/code.js2
-rw-r--r--test/bun.js/solid-dom-fixtures/customElements/code.js2
-rw-r--r--test/bun.js/some-fs.js6
-rw-r--r--test/bun.js/spawn.test.ts36
-rw-r--r--test/bun.js/sql-raw.test.js26
-rw-r--r--test/bun.js/sqlite.test.js46
-rw-r--r--test/bun.js/streams.test.js2
-rw-r--r--test/bun.js/string-decoder.test.js88
-rw-r--r--test/bun.js/tcp-server.test.ts8
-rw-r--r--test/bun.js/test_scope_debug.ts27
-rw-r--r--test/bun.js/text-decoder.test.js2
-rw-r--r--test/bun.js/text-encoder.test.js6
-rw-r--r--test/bun.js/toml.test.js4
-rw-r--r--test/bun.js/transpiler.test.js280
-rw-r--r--test/bun.js/tsconfig.json23
-rw-r--r--test/bun.js/url.test.ts31
-rw-r--r--test/bun.js/util/util-promisify.test.js151
-rw-r--r--test/bun.js/util/util.test.js10
-rw-r--r--test/bun.js/web-crypto.test.ts12
-rw-r--r--test/bun.js/web-globals.test.js6
-rw-r--r--test/bun.js/websocket-server.test.ts57
-rw-r--r--test/bun.js/which.test.ts8
69 files changed, 3949 insertions, 1036 deletions
diff --git a/test/bun.js/arraybuffersink.test.ts b/test/bun.js/arraybuffersink.test.ts
index a658556a5..a0c25ceb9 100644
--- a/test/bun.js/arraybuffersink.test.ts
+++ b/test/bun.js/arraybuffersink.test.ts
@@ -11,14 +11,14 @@ describe("ArrayBufferSink", () => {
[
["abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"],
new TextEncoder().encode(
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
),
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
],
[
["😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"],
new TextEncoder().encode(
- "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"
+ "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
),
"😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
],
@@ -29,7 +29,7 @@ describe("ArrayBufferSink", () => {
],
new TextEncoder().encode(
"abcdefghijklmnopqrstuvwxyz" +
- "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"
+ "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
),
"abcdefghijklmnopqrstuvwxyz" +
"😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
@@ -43,7 +43,7 @@ describe("ArrayBufferSink", () => {
],
new TextEncoder().encode(
"abcdefghijklmnopqrstuvwxyz" +
- "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"
+ "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
),
"(rope) " +
"abcdefghijklmnopqrstuvwxyz" +
@@ -58,19 +58,22 @@ describe("ArrayBufferSink", () => {
],
new TextEncoder().encode(
"abcdefghijklmnopqrstuvwxyz" +
- "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"
+ "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
),
"(array) " +
"abcdefghijklmnopqrstuvwxyz" +
"😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
],
- ];
+ ] as const;
for (const [input, expected, label] of fixtures) {
it(`${JSON.stringify(label)}`, () => {
const sink = new ArrayBufferSink();
for (let i = 0; i < input.length; i++) {
- sink.write(input[i]);
+ const el = input[i];
+ if (typeof el !== "number") {
+ sink.write(el);
+ }
}
const output = new Uint8Array(sink.end());
for (let i = 0; i < expected.length; i++) {
diff --git a/test/bun.js/bigint.test.js b/test/bun.js/bigint.test.js
index 8842c49fb..46ad50b84 100644
--- a/test/bun.js/bigint.test.js
+++ b/test/bun.js/bigint.test.js
@@ -2,13 +2,13 @@ import { describe, expect, it } from "bun:test";
describe("BigInt", () => {
it("compares correctly (literal)", () => {
- expect(42n).toBe(42n);
+ expect(42n).toBe(42n);
});
it("compares correctly (object)", () => {
- expect(BigInt(42n)).toBe(BigInt(42n));
- expect(42n).toBe(BigInt(42n));
- expect(BigInt(Bun.inspect(42n).substring(0, 2))).toBe(BigInt(42n));
- expect(BigInt(42n).valueOf()).toBe(BigInt(42n));
+ expect(BigInt(42n)).toBe(BigInt(42n));
+ expect(42n).toBe(BigInt(42n));
+ expect(BigInt(Bun.inspect(42n).substring(0, 2))).toBe(BigInt(42n));
+ expect(BigInt(42n).valueOf()).toBe(BigInt(42n));
});
-})
+});
diff --git a/test/bun.js/body-mixin-errors.test.ts b/test/bun.js/body-mixin-errors.test.ts
index cec812c3f..f57bbc56c 100644
--- a/test/bun.js/body-mixin-errors.test.ts
+++ b/test/bun.js/body-mixin-errors.test.ts
@@ -10,7 +10,7 @@ describe("body-mixin-errors", () => {
try {
await res.text();
throw new Error("should not get here");
- } catch (e) {
+ } catch (e: any) {
expect(e.message).toBe("Body already used");
}
});
diff --git a/test/bun.js/body-stream.test.ts b/test/bun.js/body-stream.test.ts
index ec0130fbf..bc6dc10f8 100644
--- a/test/bun.js/body-stream.test.ts
+++ b/test/bun.js/body-stream.test.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
import { file, gc, serve, ServeOptions } from "bun";
import { afterEach, describe, expect, it, test } from "bun:test";
import { readFileSync } from "fs";
@@ -15,9 +16,9 @@ var port = 4020;
];
const useRequestObjectValues = [true, false];
- for (let RequestPrototyeMixin of BodyMixin) {
+ for (let RequestPrototypeMixin of BodyMixin) {
for (let useRequestObject of useRequestObjectValues) {
- describe(`Request.prototoype.${RequestPrototyeMixin.name}() ${
+ describe(`Request.prototoype.${RequestPrototypeMixin.name}() ${
useRequestObject ? "fetch(req)" : "fetch(url)"
}`, () => {
const inputFixture = [
@@ -33,42 +34,43 @@ var port = 4020;
[
JSON.stringify(
"EXTREMELY LONG VERY LONG STRING WOW SO LONG YOU WONT BELIEVE IT! ".repeat(
- 100
- )
+ 100,
+ ),
),
Buffer.from(
JSON.stringify(
"EXTREMELY LONG VERY LONG STRING WOW SO LONG YOU WONT BELIEVE IT! ".repeat(
- 100
- )
- )
+ 100,
+ ),
+ ),
),
],
[
JSON.stringify(
"EXTREMELY LONG 🔥 UTF16 🔥 VERY LONG STRING WOW SO LONG YOU WONT BELIEVE IT! ".repeat(
- 100
- )
+ 100,
+ ),
),
Buffer.from(
JSON.stringify(
"EXTREMELY LONG 🔥 UTF16 🔥 VERY LONG STRING WOW SO LONG YOU WONT BELIEVE IT! ".repeat(
- 100
- )
- )
+ 100,
+ ),
+ ),
),
],
];
+
for (const [name, input] of inputFixture) {
test(`${name.slice(
0,
- Math.min(name.length ?? name.byteLength, 64)
+ Math.min(name.length ?? name.byteLength, 64),
)}`, async () => {
await runInServer(
{
async fetch(req) {
- var result = await RequestPrototyeMixin.call(req);
- if (RequestPrototyeMixin === Request.prototype.json) {
+ var result = await RequestPrototypeMixin.call(req);
+ if (RequestPrototypeMixin === Request.prototype.json) {
result = JSON.stringify(result);
}
if (typeof result === "string") {
@@ -76,15 +78,15 @@ var port = 4020;
expect(result).toBe(name);
} else if (result && result instanceof Blob) {
expect(result.size).toBe(
- new TextEncoder().encode(name).byteLength
+ new TextEncoder().encode(name).byteLength,
);
expect(await result.text()).toBe(name);
} else {
expect(result.byteLength).toBe(
- Buffer.from(input).byteLength
+ Buffer.from(input).byteLength,
);
expect(Bun.SHA1.hash(result, "base64")).toBe(
- Bun.SHA1.hash(input, "base64")
+ Bun.SHA1.hash(input, "base64"),
);
}
return new Response(result, {
@@ -106,7 +108,7 @@ var port = 4020;
headers: {
"content-type": "text/plain",
},
- })
+ }),
);
} else {
response = await fetch(url, {
@@ -120,7 +122,7 @@ var port = 4020;
expect(response.status).toBe(200);
expect(response.headers.get("content-length")).toBe(
- String(Buffer.from(input).byteLength)
+ String(Buffer.from(input).byteLength),
);
expect(response.headers.get("content-type")).toBe("text/plain");
expect(await response.text()).toBe(name);
@@ -137,7 +139,7 @@ var port = 4020;
"content-type": "text/plain",
"x-counter": i,
},
- })
+ }),
);
} else {
promises[i] = await fetch(url, {
@@ -156,15 +158,15 @@ var port = 4020;
const response = results[i];
expect(response.status).toBe(200);
expect(response.headers.get("content-length")).toBe(
- String(Buffer.from(input).byteLength)
+ String(Buffer.from(input).byteLength),
);
expect(response.headers.get("content-type")).toBe(
- "text/plain"
+ "text/plain",
);
expect(response.headers.get("x-counter")).toBe(String(i));
expect(await response.text()).toBe(name);
}
- }
+ },
);
});
}
@@ -175,7 +177,7 @@ var port = 4020;
async function runInServer(
opts: ServeOptions,
- cb: (url: string) => void | Promise<void>
+ cb: (url: string) => void | Promise<void>,
) {
var server;
server = Bun.serve({
@@ -276,7 +278,7 @@ describe("reader", function () {
new Float32Array(bytes).subarray(1),
new Float32Array(bytes).subarray(
0,
- new Float32Array(bytes).byteLength - 1
+ new Float32Array(bytes).byteLength - 1,
),
new Int16Array(bytes).subarray(0, 1),
new Int32Array(bytes).subarray(0, 1),
@@ -295,7 +297,7 @@ describe("reader", function () {
huge instanceof Blob
? Bun.SHA1.hash(
new Uint8Array(await huge.arrayBuffer()),
- "base64"
+ "base64",
)
: Bun.SHA1.hash(huge, "base64");
const expectedSize =
@@ -308,14 +310,14 @@ describe("reader", function () {
expect(req.headers.get("x-custom")).toBe("hello");
expect(req.headers.get("content-type")).toBe("text/plain");
expect(req.headers.get("user-agent")).toBe(
- navigator.userAgent
+ navigator.userAgent,
);
gc();
expect(req.headers.get("x-custom")).toBe("hello");
expect(req.headers.get("content-type")).toBe("text/plain");
expect(req.headers.get("user-agent")).toBe(
- navigator.userAgent
+ navigator.userAgent,
);
var reader = req.body.getReader();
@@ -330,12 +332,12 @@ describe("reader", function () {
gc();
expect(out.size).toBe(expectedSize);
expect(Bun.SHA1.hash(await out.arrayBuffer(), "base64")).toBe(
- expectedHash
+ expectedHash,
);
expect(req.headers.get("x-custom")).toBe("hello");
expect(req.headers.get("content-type")).toBe("text/plain");
expect(req.headers.get("user-agent")).toBe(
- navigator.userAgent
+ navigator.userAgent,
);
gc();
return new Response(out, {
@@ -361,7 +363,7 @@ describe("reader", function () {
huge = undefined;
expect(response.status).toBe(200);
const response_body = new Uint8Array(
- await response.arrayBuffer()
+ await response.arrayBuffer(),
);
expect(response_body.byteLength).toBe(expectedSize);
@@ -370,7 +372,7 @@ describe("reader", function () {
gc();
expect(response.headers.get("content-type")).toBe("text/plain");
gc();
- }
+ },
);
expect(called).toBe(true);
gc();
@@ -392,7 +394,7 @@ describe("reader", function () {
huge instanceof Blob
? Bun.SHA1.hash(
new Uint8Array(await huge.arrayBuffer()),
- "base64"
+ "base64",
)
: Bun.SHA1.hash(huge, "base64");
const expectedSize =
@@ -415,19 +417,19 @@ describe("reader", function () {
expect(req.headers.get("x-custom")).toBe("hello");
expect(req.headers.get("content-type")).toBe(
- "text/plain"
+ "text/plain",
);
expect(req.headers.get("user-agent")).toBe(
- navigator.userAgent
+ navigator.userAgent,
);
gc();
expect(req.headers.get("x-custom")).toBe("hello");
expect(req.headers.get("content-type")).toBe(
- "text/plain"
+ "text/plain",
);
expect(req.headers.get("user-agent")).toBe(
- navigator.userAgent
+ navigator.userAgent,
);
const direct = {
@@ -464,7 +466,7 @@ describe("reader", function () {
new ReadableStream(isDirectStream ? direct : web),
{
headers: req.headers,
- }
+ },
);
} catch (e) {
console.error(e);
@@ -486,26 +488,26 @@ describe("reader", function () {
huge = undefined;
expect(response.status).toBe(200);
const response_body = new Uint8Array(
- await response.arrayBuffer()
+ await response.arrayBuffer(),
);
expect(response_body.byteLength).toBe(expectedSize);
expect(Bun.SHA1.hash(response_body, "base64")).toBe(
- expectedHash
+ expectedHash,
);
gc();
if (!response.headers.has("content-type")) {
console.error(
- Object.fromEntries(response.headers.entries())
+ Object.fromEntries(response.headers.entries()),
);
}
expect(response.headers.get("content-type")).toBe(
- "text/plain"
+ "text/plain",
);
gc();
- }
+ },
);
expect(called).toBe(true);
gc();
diff --git a/test/bun.js/buffer.test.js b/test/bun.js/buffer.test.js
index 4433cf64f..5a367f725 100644
--- a/test/bun.js/buffer.test.js
+++ b/test/bun.js/buffer.test.js
@@ -9,7 +9,7 @@ it("Buffer.toJSON()", () => {
JSON.stringify({
type: "Buffer",
data: [104, 101, 108, 108, 111],
- })
+ }),
);
});
@@ -26,7 +26,7 @@ it("buffer", () => {
expect(buf.toString("utf8", 0, "hello world ".length)).toBe("hello world ");
gc();
expect(buf.toString("base64url", 0, "hello world ".length)).toBe(
- btoa("hello world ")
+ btoa("hello world "),
);
gc();
expect(buf instanceof Uint8Array).toBe(true);
@@ -65,7 +65,7 @@ it("Buffer", () => {
it("Buffer.byteLength", () => {
expect(Buffer.byteLength("😀😃😄😁😆😅😂🤣☺️😊😊😇")).toBe(
- new TextEncoder().encode("😀😃😄😁😆😅😂🤣☺️😊😊😇").byteLength
+ new TextEncoder().encode("😀😃😄😁😆😅😂🤣☺️😊😊😇").byteLength,
);
});
@@ -120,7 +120,7 @@ it("Buffer.toBuffer works", () => {
expect(buf.toString("utf8", 0, "hello world ".length)).toBe("hello world ");
gc();
expect(buf.toString("base64url", 0, "hello world ".length)).toBe(
- btoa("hello world ")
+ btoa("hello world "),
);
gc();
@@ -149,10 +149,10 @@ it("writeInt", () => {
it("Buffer.from", () => {
expect(Buffer.from("hello world").toString("utf8")).toBe("hello world");
expect(Buffer.from("hello world", "ascii").toString("utf8")).toBe(
- "hello world"
+ "hello world",
);
expect(Buffer.from("hello world", "latin1").toString("utf8")).toBe(
- "hello world"
+ "hello world",
);
gc();
expect(Buffer.from([254]).join(",")).toBe("254");
@@ -166,15 +166,15 @@ it("Buffer.from", () => {
expect(Buffer.from(123).join(",")).toBe(Uint8Array.from(123).join(","));
expect(Buffer.from({ length: 124 }).join(",")).toBe(
- Uint8Array.from({ length: 124 }).join(",")
+ Uint8Array.from({ length: 124 }).join(","),
);
expect(Buffer.from(new ArrayBuffer(1024), 0, 512).join(",")).toBe(
- new Uint8Array(512).join(",")
+ new Uint8Array(512).join(","),
);
expect(Buffer.from(new Buffer(new ArrayBuffer(1024), 0, 512)).join(",")).toBe(
- new Uint8Array(512).join(",")
+ new Uint8Array(512).join(","),
);
gc();
});
@@ -254,7 +254,7 @@ it("Buffer.compare", () => {
[buf.slice(i), Buffer.from(s.slice(i))],
[buf.slice(0, i), Buffer.from(s.slice(0, i))],
[buf.slice(-i), Buffer.from(s.slice(-i))],
- [buf.slice(0, -i), Buffer.from(s.slice(0, -i))]
+ [buf.slice(0, -i), Buffer.from(s.slice(0, -i))],
);
}
@@ -375,14 +375,14 @@ it("Buffer.concat", () => {
array3.fill(300);
gc();
expect(Buffer.concat([array1, array2, array3]).join("")).toBe(
- array1.join("") + array2.join("") + array3.join("")
+ array1.join("") + array2.join("") + array3.join(""),
);
expect(Buffer.concat([array1, array2, array3], 222).length).toBe(222);
expect(
- Buffer.concat([array1, array2, array3], 222).subarray(0, 128).join("")
+ Buffer.concat([array1, array2, array3], 222).subarray(0, 128).join(""),
).toBe("100".repeat(128));
expect(
- Buffer.concat([array1, array2, array3], 222).subarray(129, 222).join("")
+ Buffer.concat([array1, array2, array3], 222).subarray(129, 222).join(""),
).toBe("200".repeat(222 - 129));
});
diff --git a/test/bun.js/bun-write.test.js b/test/bun.js/bun-write.test.js
index e78c05e66..e7d724572 100644
--- a/test/bun.js/bun-write.test.js
+++ b/test/bun.js/bun-write.test.js
@@ -6,14 +6,14 @@ import { gcTick } from "./gc";
it("Bun.write blob", async () => {
await Bun.write(
Bun.file("/tmp/response-file.test.txt"),
- Bun.file(path.join(import.meta.dir, "fetch.js.txt"))
+ Bun.file(path.join(import.meta.dir, "fetch.js.txt")),
);
await gcTick();
await Bun.write(Bun.file("/tmp/response-file.test.txt"), "blah blah blha");
await gcTick();
await Bun.write(
Bun.file("/tmp/response-file.test.txt"),
- new Uint32Array(1024)
+ new Uint32Array(1024),
);
await gcTick();
await Bun.write("/tmp/response-file.test.txt", new Uint32Array(1024));
@@ -21,8 +21,8 @@ it("Bun.write blob", async () => {
expect(
await Bun.write(
new TextEncoder().encode("/tmp/response-file.test.txt"),
- new Uint32Array(1024)
- )
+ new Uint32Array(1024),
+ ),
).toBe(new Uint32Array(1024).byteLength);
await gcTick();
});
@@ -32,7 +32,7 @@ describe("large file", () => {
[
`/tmp/bun-test-large-file-${Date.now()}.txt`,
"https://www.iana.org/assignments/media-types/media-types.xhtml,".repeat(
- 10000
+ 10000,
),
],
];
@@ -59,8 +59,8 @@ describe("large file", () => {
expect(written).toBe(bytes.byteLength);
expect(
new Buffer(await Bun.file(filename + ".bytes").arrayBuffer()).equals(
- bytes
- )
+ bytes,
+ ),
).toBe(true);
try {
@@ -130,7 +130,7 @@ it("Bun.file -> Bun.file", async () => {
{
const result = await Bun.write(
Bun.file("/tmp/fetch.js.out"),
- Bun.file("/tmp/fetch.js.in")
+ Bun.file("/tmp/fetch.js.in"),
);
await gcTick();
expect(await Bun.file("/tmp/fetch.js.out").text()).toBe(text);
@@ -140,10 +140,10 @@ it("Bun.file -> Bun.file", async () => {
{
await Bun.write(
Bun.file("/tmp/fetch.js.in").slice(0, (text.length / 2) | 0),
- Bun.file("/tmp/fetch.js.out")
+ Bun.file("/tmp/fetch.js.out"),
);
expect(await Bun.file("/tmp/fetch.js.in").text()).toBe(
- text.substring(0, (text.length / 2) | 0)
+ text.substring(0, (text.length / 2) | 0),
);
}
@@ -266,8 +266,8 @@ it("Bun.write(Bun.stdout, new TextEncoder().encode('Bun.write STDOUT TEST'))", a
expect(
await Bun.write(
Bun.stdout,
- new TextEncoder().encode("\nBun.write STDOUT TEST\n\n")
- )
+ new TextEncoder().encode("\nBun.write STDOUT TEST\n\n"),
+ ),
).toBe(24);
});
@@ -275,8 +275,8 @@ it("Bun.write(Bun.stderr, 'new TextEncoder().encode(Bun.write STDERR TEST'))", a
expect(
await Bun.write(
Bun.stderr,
- new TextEncoder().encode("\nBun.write STDERR TEST\n\n")
- )
+ new TextEncoder().encode("\nBun.write STDERR TEST\n\n"),
+ ),
).toBe(24);
});
@@ -294,6 +294,6 @@ it("Bun.write('output.html', HTMLRewriter.transform(Bun.file)))", async () => {
const outpath = `/tmp/html-rewriter.${Date.now()}.html`;
await Bun.write(outpath, output);
expect(await Bun.file(outpath).text()).toBe(
- "<div><blink>it worked!</blink></div>"
+ "<div><blink>it worked!</blink></div>",
);
});
diff --git a/test/bun.js/bundled/tsconfig.json b/test/bun.js/bundled/tsconfig.json
index 358cb5526..3ccb11ae4 100644
--- a/test/bun.js/bundled/tsconfig.json
+++ b/test/bun.js/bundled/tsconfig.json
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"paths": {},
- "baseUrl": "."
+ "baseUrl": ".",
}
-}
+} \ No newline at end of file
diff --git a/test/bun.js/child_process-node.test.js b/test/bun.js/child_process-node.test.js
index 3ac9b2fd1..17b2c4cfb 100644
--- a/test/bun.js/child_process-node.test.js
+++ b/test/bun.js/child_process-node.test.js
@@ -62,7 +62,7 @@ describe("ChildProcess.spawn()", () => {
// message:
// 'The "options" argument must be of type object.' +
// `${common.invalidArgTypeHelper(options)}`,
- }
+ },
);
});
});
@@ -81,7 +81,7 @@ describe("ChildProcess.spawn()", () => {
// message:
// 'The "options.file" property must be of type string.' +
// `${common.invalidArgTypeHelper(file)}`,
- }
+ },
);
});
});
@@ -104,7 +104,7 @@ describe("ChildProcess.spawn()", () => {
// message:
// 'The "options.envPairs" property must be an instance of Array.' +
// common.invalidArgTypeHelper(envPairs),
- }
+ },
);
});
});
@@ -124,7 +124,7 @@ describe("ChildProcess.spawn()", () => {
// message:
// 'The "options.args" property must be an instance of Array.' +
// common.invalidArgTypeHelper(args),
- }
+ },
);
});
});
@@ -153,7 +153,7 @@ describe("ChildProcess.spawn", () => {
() => {
child.kill("foo");
},
- { code: "ERR_UNKNOWN_SIGNAL", name: "TypeError" }
+ { code: "ERR_UNKNOWN_SIGNAL", name: "TypeError" },
);
});
@@ -194,7 +194,7 @@ describe("ChildProcess spawn bad stdio", () => {
strictEqual(stdout, "");
strictEqual(stderr, "");
},
- done
+ done,
);
});
@@ -207,7 +207,7 @@ describe("ChildProcess spawn bad stdio", () => {
strictEqual(stdout, "");
strictEqual(stderr, "");
},
- done
+ done,
);
child.emit("error", error);
@@ -221,7 +221,7 @@ describe("ChildProcess spawn bad stdio", () => {
strictEqual(stdout, "");
strictEqual(stderr, "");
},
- done
+ done,
);
});
});
@@ -234,7 +234,7 @@ describe("child_process cwd", () => {
function testCwd(
options,
{ expectPidType, expectCode = 0, expectData },
- done = () => {}
+ done = () => {},
) {
const createDone = createDoneDotAll(done);
const { mustCall } = createCallCheckCtx(createDone(1500));
@@ -268,7 +268,7 @@ describe("child_process cwd", () => {
"close",
mustCall(() => {
expectData && strictEqual(data.trim(), expectData);
- })
+ }),
);
return child;
@@ -326,7 +326,7 @@ describe("child_process cwd", () => {
expectCode: 0,
expectData: platformTmpDir,
},
- createDone(1500)
+ createDone(1500),
);
const shouldExistDir = "/dev";
testCwd(
@@ -336,7 +336,7 @@ describe("child_process cwd", () => {
expectCode: 0,
expectData: shouldExistDir,
},
- createDone(1500)
+ createDone(1500),
);
testCwd(
{ cwd: Bun.pathToFileURL(tmpdir.path) },
@@ -345,7 +345,7 @@ describe("child_process cwd", () => {
expectCode: 0,
expectData: platformTmpDir,
},
- createDone(1500)
+ createDone(1500),
);
});
@@ -375,7 +375,7 @@ describe("child_process default options", () => {
assertOk(
response.includes(`TMPDIR=${process.env.TMPDIR}`),
"spawn did not use process.env as default " +
- `(process.env.TMPDIR = ${process.env.TMPDIR})`
+ `(process.env.TMPDIR = ${process.env.TMPDIR})`,
);
done();
});
@@ -398,7 +398,7 @@ describe("child_process double pipe", () => {
if (!grep.stdin.write(data)) {
echo.stdout.pause();
}
- })
+ }),
);
// TODO(Derrick): We don't implement the full API for this yet,
@@ -415,28 +415,28 @@ describe("child_process double pipe", () => {
mustCall(() => {
debug("echo stdout end");
grep.stdin.end();
- })
+ }),
);
echo.on(
"exit",
mustCall(() => {
debug("echo exit");
- })
+ }),
);
grep.on(
"exit",
mustCall(() => {
debug("grep exit");
- })
+ }),
);
sed.on(
"exit",
mustCall(() => {
debug("sed exit");
- })
+ }),
);
// pipe grep | sed
@@ -447,7 +447,7 @@ describe("child_process double pipe", () => {
if (!sed.stdin.write(data)) {
grep.stdout.pause();
}
- })
+ }),
);
// // TODO(@jasnell): This does not appear to ever be
@@ -462,7 +462,7 @@ describe("child_process double pipe", () => {
mustCall((code) => {
debug("grep stdout end");
sed.stdin.end();
- })
+ }),
);
let result = "";
@@ -473,7 +473,7 @@ describe("child_process double pipe", () => {
mustCallAtLeast((data) => {
result += data.toString("utf8");
debug(data);
- })
+ }),
);
sed.stdout.on(
@@ -481,7 +481,7 @@ describe("child_process double pipe", () => {
mustCall(() => {
debug("result: " + result);
strictEqual(result, `hellO\nnOde\nwOrld\n`);
- })
+ }),
);
});
});
diff --git a/test/bun.js/child_process.test.ts b/test/bun.js/child_process.test.ts
index 536f4947b..fecc5b961 100644
--- a/test/bun.js/child_process.test.ts
+++ b/test/bun.js/child_process.test.ts
@@ -57,7 +57,9 @@ describe("spawn()", () => {
let child;
let child2;
try {
+ // @ts-ignore
child = spawn(123);
+ // @ts-ignore
child2 = spawn(["echo", "hello"]);
} catch (e) {}
expect(!!child).toBe(false);
@@ -203,12 +205,17 @@ describe("spawn()", () => {
describe("execFile()", () => {
it("should execute a file", async () => {
const result: Buffer = await new Promise((resolve, reject) => {
- execFile("bun", ["-v"], (error, stdout, stderr) => {
- if (error) {
- reject(error);
- }
- resolve(stdout);
- });
+ execFile(
+ "bun",
+ ["-v"],
+ { encoding: "buffer" },
+ (error, stdout, stderr) => {
+ if (error) {
+ reject(error);
+ }
+ resolve(stdout);
+ },
+ );
});
expect(SEMVER_REGEX.test(result.toString().trim())).toBe(true);
});
@@ -217,7 +224,7 @@ describe("execFile()", () => {
describe("exec()", () => {
it("should execute a command in a shell", async () => {
const result: Buffer = await new Promise((resolve, reject) => {
- exec("bun -v", (error, stdout, stderr) => {
+ exec("bun -v", { encoding: "buffer" }, (error, stdout, stderr) => {
if (error) {
reject(error);
}
diff --git a/test/bun.js/concat.test.js b/test/bun.js/concat.test.js
index a965fdb94..35cec4f8b 100644
--- a/test/bun.js/concat.test.js
+++ b/test/bun.js/concat.test.js
@@ -28,19 +28,19 @@ describe("concat", () => {
it("works with one element", () => {
expect(concatToString([new Uint8Array([123])])).toBe(
- polyfillToString([new Uint8Array([123])])
+ polyfillToString([new Uint8Array([123])]),
);
});
it("works with two elements", () => {
expect(
- concatToString([Uint8Array.from([123]), Uint8Array.from([456])])
+ concatToString([Uint8Array.from([123]), Uint8Array.from([456])]),
).toBe(polyfillToString([Uint8Array.from([123]), Uint8Array.from([456])]));
});
it("works with mix of ArrayBuffer and TypedArray elements", () => {
expect(
- concatToString([Uint8Array.from([123]).buffer, Uint8Array.from([456])])
+ concatToString([Uint8Array.from([123]).buffer, Uint8Array.from([456])]),
).toBe(polyfillToString([Uint8Array.from([123]), Uint8Array.from([456])]));
});
});
diff --git a/test/bun.js/console-log.js b/test/bun.js/console-log.js
index 5c110f8b0..6252d6773 100644
--- a/test/bun.js/console-log.js
+++ b/test/bun.js/console-log.js
@@ -36,7 +36,7 @@ console.time("Check");
console.log(
"Is it a bug or a feature that formatting numbers like %d is colored",
- 123
+ 123,
);
console.log(globalThis);
@@ -46,7 +46,7 @@ console.log(
"456",
"%s",
"What",
- "okay"
+ "okay",
);
const infinteLoop = {
@@ -57,4 +57,4 @@ const infinteLoop = {
infinteLoop.bar = infinteLoop;
console.log(infinteLoop, "am");
-console.log(new Array(4).fill({}))
+console.log(new Array(4).fill({}));
diff --git a/test/bun.js/decorators.test.ts b/test/bun.js/decorators.test.ts
index 545030ef1..554904107 100644
--- a/test/bun.js/decorators.test.ts
+++ b/test/bun.js/decorators.test.ts
@@ -1,3 +1,4 @@
+// @ts-nocheck
import { test, expect } from "bun:test";
test("decorator order of evaluation", () => {
@@ -264,7 +265,7 @@ test("parameter decorators", () => {
two: string,
three: boolean,
@d1 @d2 width: number,
- @d3 height: number
+ @d3 height: number,
) {
this.width = width;
this.height = height;
@@ -336,7 +337,7 @@ test("parameter decorators", () => {
constructor(
@m1 private x: number,
@m2 public y: boolean,
- @m3 protected z: string
+ @m3 protected z: string,
) {}
}
diff --git a/test/bun.js/escapeHTML.test.js b/test/bun.js/escapeHTML.test.js
index 5ea202a75..af119c6e3 100644
--- a/test/bun.js/escapeHTML.test.js
+++ b/test/bun.js/escapeHTML.test.js
@@ -14,10 +14,10 @@ describe("escapeHTML", () => {
// 8. Returns the same string when there's no need to escape
it("works", () => {
expect(escapeHTML("absolutely nothing to do here")).toBe(
- "absolutely nothing to do here"
+ "absolutely nothing to do here",
);
expect(escapeHTML("<script>alert(1)</script>")).toBe(
- "&lt;script&gt;alert(1)&lt;/script&gt;"
+ "&lt;script&gt;alert(1)&lt;/script&gt;",
);
expect(escapeHTML("<")).toBe("&lt;");
expect(escapeHTML(">")).toBe("&gt;");
@@ -36,66 +36,66 @@ describe("escapeHTML", () => {
expect(escapeHTML("<script><script>")).toBe("&lt;script&gt;&lt;script&gt;");
expect(escapeHTML("lalala" + "<script>alert(1)</script>" + "lalala")).toBe(
- "lalala&lt;script&gt;alert(1)&lt;/script&gt;lalala"
+ "lalala&lt;script&gt;alert(1)&lt;/script&gt;lalala",
);
expect(escapeHTML("<script>alert(1)</script>" + "lalala")).toBe(
- "&lt;script&gt;alert(1)&lt;/script&gt;lalala"
+ "&lt;script&gt;alert(1)&lt;/script&gt;lalala",
);
expect(escapeHTML("lalala" + "<script>alert(1)</script>")).toBe(
- "lalala" + "&lt;script&gt;alert(1)&lt;/script&gt;"
+ "lalala" + "&lt;script&gt;alert(1)&lt;/script&gt;",
);
expect(escapeHTML("What does 😊 mean?")).toBe("What does 😊 mean?");
const output = escapeHTML("<What does 😊");
expect(output).toBe("&lt;What does 😊");
expect(escapeHTML("<div>What does 😊 mean in text?")).toBe(
- "&lt;div&gt;What does 😊 mean in text?"
+ "&lt;div&gt;What does 😊 mean in text?",
);
expect(
escapeHTML(
- ("lalala" + "<script>alert(1)</script>" + "lalala").repeat(900)
- )
+ ("lalala" + "<script>alert(1)</script>" + "lalala").repeat(900),
+ ),
).toBe("lalala&lt;script&gt;alert(1)&lt;/script&gt;lalala".repeat(900));
expect(
- escapeHTML(("<script>alert(1)</script>" + "lalala").repeat(900))
+ escapeHTML(("<script>alert(1)</script>" + "lalala").repeat(900)),
).toBe("&lt;script&gt;alert(1)&lt;/script&gt;lalala".repeat(900));
expect(
- escapeHTML(("lalala" + "<script>alert(1)</script>").repeat(900))
+ escapeHTML(("lalala" + "<script>alert(1)</script>").repeat(900)),
).toBe(("lalala" + "&lt;script&gt;alert(1)&lt;/script&gt;").repeat(900));
// the positions of the unicode codepoint are important
// our simd code for U16 is at 8 bytes, so we need to especially check the boundaries
expect(
- escapeHTML("😊lalala" + "<script>alert(1)</script>" + "lalala")
+ escapeHTML("😊lalala" + "<script>alert(1)</script>" + "lalala"),
).toBe("😊lalala&lt;script&gt;alert(1)&lt;/script&gt;lalala");
expect(escapeHTML("<script>😊alert(1)</script>" + "lalala")).toBe(
- "&lt;script&gt;😊alert(1)&lt;/script&gt;lalala"
+ "&lt;script&gt;😊alert(1)&lt;/script&gt;lalala",
);
expect(escapeHTML("<script>alert(1)😊</script>" + "lalala")).toBe(
- "&lt;script&gt;alert(1)😊&lt;/script&gt;lalala"
+ "&lt;script&gt;alert(1)😊&lt;/script&gt;lalala",
);
expect(escapeHTML("<script>alert(1)</script>" + "😊lalala")).toBe(
- "&lt;script&gt;alert(1)&lt;/script&gt;😊lalala"
+ "&lt;script&gt;alert(1)&lt;/script&gt;😊lalala",
);
expect(escapeHTML("<script>alert(1)</script>" + "lal😊ala")).toBe(
- "&lt;script&gt;alert(1)&lt;/script&gt;lal😊ala"
+ "&lt;script&gt;alert(1)&lt;/script&gt;lal😊ala",
);
expect(
- escapeHTML("<script>alert(1)</script>" + "lal😊ala".repeat(10))
+ escapeHTML("<script>alert(1)</script>" + "lal😊ala".repeat(10)),
).toBe("&lt;script&gt;alert(1)&lt;/script&gt;" + "lal😊ala".repeat(10));
for (let i = 1; i < 10; i++)
expect(escapeHTML("<script>alert(1)</script>" + "la😊".repeat(i))).toBe(
- "&lt;script&gt;alert(1)&lt;/script&gt;" + "la😊".repeat(i)
+ "&lt;script&gt;alert(1)&lt;/script&gt;" + "la😊".repeat(i),
);
expect(escapeHTML("la😊" + "<script>alert(1)</script>")).toBe(
- "la😊" + "&lt;script&gt;alert(1)&lt;/script&gt;"
+ "la😊" + "&lt;script&gt;alert(1)&lt;/script&gt;",
);
expect(
- escapeHTML(("lalala" + "<script>alert(1)</script>😊").repeat(1))
+ escapeHTML(("lalala" + "<script>alert(1)</script>😊").repeat(1)),
).toBe(("lalala" + "&lt;script&gt;alert(1)&lt;/script&gt;😊").repeat(1));
expect(escapeHTML("😊".repeat(100))).toBe("😊".repeat(100));
diff --git a/test/bun.js/event-emitter.test.ts b/test/bun.js/event-emitter.test.ts
index 952805cf8..f7c73e66a 100644
--- a/test/bun.js/event-emitter.test.ts
+++ b/test/bun.js/event-emitter.test.ts
@@ -1,4 +1,5 @@
import { test, describe, expect } from "bun:test";
+import fs from "node:fs";
// this is also testing that imports with default and named imports in the same statement work
// our transpiler transform changes this to a var with import.meta.require
diff --git a/test/bun.js/fetch.test.js b/test/bun.js/fetch.test.js
index 603cdfb3c..ebcdcbc8b 100644
--- a/test/bun.js/fetch.test.js
+++ b/test/bun.js/fetch.test.js
@@ -5,7 +5,7 @@ import { gc } from "./gc";
const exampleFixture = fs.readFileSync(
import.meta.path.substring(0, import.meta.path.lastIndexOf("/")) +
"/fetch.js.txt",
- "utf8"
+ "utf8",
);
describe("fetch", () => {
@@ -74,7 +74,7 @@ function testBlobInterface(blobbyConstructor, hasBlobFn) {
var response = blobbyConstructor(JSON.stringify(jsonObject));
if (withGC) gc();
expect(JSON.stringify(await response.json())).toBe(
- JSON.stringify(jsonObject)
+ JSON.stringify(jsonObject),
);
if (withGC) gc();
});
@@ -84,11 +84,11 @@ function testBlobInterface(blobbyConstructor, hasBlobFn) {
} arrayBuffer -> json${withGC ? " (with gc) " : ""}`, async () => {
if (withGC) gc();
var response = blobbyConstructor(
- new TextEncoder().encode(JSON.stringify(jsonObject))
+ new TextEncoder().encode(JSON.stringify(jsonObject)),
);
if (withGC) gc();
expect(JSON.stringify(await response.json())).toBe(
- JSON.stringify(jsonObject)
+ JSON.stringify(jsonObject),
);
if (withGC) gc();
});
@@ -108,7 +108,7 @@ function testBlobInterface(blobbyConstructor, hasBlobFn) {
} arrayBuffer -> text${withGC ? " (with gc) " : ""}`, async () => {
if (withGC) gc();
var response = blobbyConstructor(
- new TextEncoder().encode(JSON.stringify(jsonObject))
+ new TextEncoder().encode(JSON.stringify(jsonObject)),
);
if (withGC) gc();
expect(await response.text()).toBe(JSON.stringify(jsonObject));
@@ -144,7 +144,7 @@ function testBlobInterface(blobbyConstructor, hasBlobFn) {
if (withGC) gc();
var response = blobbyConstructor(
- new TextEncoder().encode(JSON.stringify(jsonObject))
+ new TextEncoder().encode(JSON.stringify(jsonObject)),
);
if (withGC) gc();
@@ -219,13 +219,13 @@ describe("Blob", () => {
[
new Blob([
new TextEncoder().encode(
- "😀 😃 😄 😁 😆 😅 😂 🤣 🥲 ☺️ 😊 😇 🙂 🙃 😉 😌 😍 🥰 😘 😗 😙 😚 😋 😛 😝 😜 🤪 🤨 🧐 🤓 😎 🥸 🤩 🥳"
+ "😀 😃 😄 😁 😆 😅 😂 🤣 🥲 ☺️ 😊 😇 🙂 🙃 😉 😌 😍 🥰 😘 😗 😙 😚 😋 😛 😝 😜 🤪 🤨 🧐 🤓 😎 🥸 🤩 🥳",
),
]),
],
[
new TextEncoder().encode(
- "😀 😃 😄 😁 😆 😅 😂 🤣 🥲 ☺️ 😊 😇 🙂 🙃 😉 😌 😍 🥰 😘 😗 😙 😚 😋 😛 😝 😜 🤪 🤨 🧐 🤓 😎 🥸 🤩 🥳"
+ "😀 😃 😄 😁 😆 😅 😂 🤣 🥲 ☺️ 😊 😇 🙂 🙃 😉 😌 😍 🥰 😘 😗 😙 😚 😋 😛 😝 😜 🤪 🤨 🧐 🤓 😎 🥸 🤩 🥳",
),
],
];
@@ -253,7 +253,7 @@ describe("Blob", () => {
.split("")
.map((a) => a.charCodeAt(0))}, received: ${res
.split("")
- .map((a) => a.charCodeAt(0))}`
+ .map((a) => a.charCodeAt(0))}`,
);
}
@@ -274,7 +274,7 @@ describe("Blob", () => {
expect(
await combined
.slice(str.indexOf(part), str.indexOf(part) + part.length)
- .text()
+ .text(),
).toBe(part);
if (withGC) gc();
}
@@ -284,7 +284,7 @@ describe("Blob", () => {
expect(
await combined
.slice(str.indexOf(part), str.indexOf(part) + part.length)
- .text()
+ .text(),
).toBe(part);
if (withGC) gc();
}
@@ -358,7 +358,7 @@ describe("Response", () => {
let response = Response.json("hello");
expect(response.type).toBe("basic");
expect(response.headers.get("content-type")).toBe(
- "application/json;charset=utf-8"
+ "application/json;charset=utf-8",
);
expect(response.status).toBe(200);
});
@@ -366,7 +366,7 @@ describe("Response", () => {
let response = Response.json("hello", 407);
expect(response.type).toBe("basic");
expect(response.headers.get("content-type")).toBe(
- "application/json;charset=utf-8"
+ "application/json;charset=utf-8",
);
expect(response.status).toBe(407);
});
@@ -485,7 +485,7 @@ describe("Request", () => {
testBlobInterface(
(data) => new Request("https://hello.com", { body: data }),
- true
+ true,
);
});
diff --git a/test/bun.js/ffi.test.fixture.callback.c b/test/bun.js/ffi.test.fixture.callback.c
index 9c3c088ce..ec83dee80 100644
--- a/test/bun.js/ffi.test.fixture.callback.c
+++ b/test/bun.js/ffi.test.fixture.callback.c
@@ -285,9 +285,6 @@ ZIG_REPR_TYPE JSFunctionCall(void* jsGlobalObject, void* callFrame);
bool my_callback_function(void* arg0);
bool my_callback_function(void* arg0) {
-#ifdef INJECT_BEFORE
-INJECT_BEFORE;
-#endif
ZIG_REPR_TYPE arguments[1];
arguments[0] = PTR_TO_JSVALUE(arg0).asZigRepr;
return (bool)JSVALUE_TO_BOOL(_FFI_Callback_call((void*)0x0UL, 1, arguments));
diff --git a/test/bun.js/ffi.test.js b/test/bun.js/ffi.test.js
index 65b29b788..e3e858b1f 100644
--- a/test/bun.js/ffi.test.js
+++ b/test/bun.js/ffi.test.js
@@ -29,8 +29,8 @@ it("ffi print", async () => {
returns: "bool",
args: ["ptr"],
},
- true
- )
+ true,
+ ),
);
await Bun.write(
import.meta.dir + "/ffi.test.fixture.receiver.c",
@@ -41,8 +41,8 @@ it("ffi print", async () => {
args: ["float"],
},
},
- false
- )[0]
+ false,
+ )[0],
);
expect(
viewSource(
@@ -50,8 +50,8 @@ it("ffi print", async () => {
returns: "int8_t",
args: [],
},
- true
- ).length > 0
+ true,
+ ).length > 0,
).toBe(true);
expect(
viewSource(
@@ -61,8 +61,8 @@ it("ffi print", async () => {
args: [],
},
},
- false
- ).length > 0
+ false,
+ ).length > 0,
).toBe(true);
});
@@ -423,17 +423,17 @@ function ffiRunner(fast) {
var bigIntArray = new BigInt64Array(bigArray.buffer);
expect(identity_uint64_t(bigArray[0])).toBe(bigArray[0]);
expect(identity_uint64_t(bigArray[0] - BigInt(1))).toBe(
- bigArray[0] - BigInt(1)
+ bigArray[0] - BigInt(1),
);
if (fast) {
expect(add_uint64_t(BigInt(-1) * bigArray[0], bigArray[0])).toBe(0);
expect(
- add_uint64_t(BigInt(-1) * bigArray[0] + BigInt(10), bigArray[0])
+ add_uint64_t(BigInt(-1) * bigArray[0] + BigInt(10), bigArray[0]),
).toBe(10);
} else {
expect(add_uint64_t(BigInt(-1) * bigArray[0], bigArray[0])).toBe(0n);
expect(
- add_uint64_t(BigInt(-1) * bigArray[0] + BigInt(10), bigArray[0])
+ add_uint64_t(BigInt(-1) * bigArray[0] + BigInt(10), bigArray[0]),
).toBe(10n);
}
if (fast) {
@@ -450,7 +450,7 @@ function ffiRunner(fast) {
expect(identity_int64_t(bigIntArray[0])).toBe(bigIntArray[0]);
expect(identity_int64_t(bigIntArray[0] - BigInt(1))).toBe(
- bigIntArray[0] - BigInt(1)
+ bigIntArray[0] - BigInt(1),
);
}
Bun.gc(true);
@@ -475,7 +475,7 @@ function ffiRunner(fast) {
const buffer = toBuffer(cptr, 0, 4);
expect(buffer.readInt32(0)).toBe(42);
expect(new DataView(toArrayBuffer(cptr, 0, 4), 0, 4).getInt32(0, true)).toBe(
- 42
+ 42,
);
expect(ptr(buffer)).toBe(cptr);
expect(new CString(cptr, 0, 1).toString()).toBe("*");
@@ -515,7 +515,7 @@ function ffiRunner(fast) {
{
returns: returnName,
args: [returnName],
- }
+ },
).ptr,
returns: returnName,
args: [returnName],
@@ -531,7 +531,7 @@ function ffiRunner(fast) {
{
returns: "bool",
args: ["bool"],
- }
+ },
);
expect(toClose.ptr > 0).toBe(true);
toClose.close();
@@ -559,7 +559,7 @@ function ffiRunner(fast) {
{
args: [name],
threadsafe: true,
- }
+ },
).ptr,
returns: "void",
args: [name],
@@ -603,10 +603,10 @@ it("read", () => {
for (let i = 0; i < buffer.length; i++) {
buffer[i] = BigInt(i);
expect(read.intptr(addr, i * 8)).toBe(
- Number(dataView.getBigInt64(i * 8, true))
+ Number(dataView.getBigInt64(i * 8, true)),
);
expect(read.ptr(addr, i * 8)).toBe(
- Number(dataView.getBigUint64(i * 8, true))
+ Number(dataView.getBigUint64(i * 8, true)),
);
expect(read.f64(addr, i + 8)).toBe(dataView.getFloat64(i + 8, true));
expect(read.i64(addr, i * 8)).toBe(dataView.getBigInt64(i * 8, true));
diff --git a/test/bun.js/fileUrl.test.js b/test/bun.js/fileUrl.test.js
index 4799f4228..7efa8f235 100644
--- a/test/bun.js/fileUrl.test.js
+++ b/test/bun.js/fileUrl.test.js
@@ -3,7 +3,7 @@ import { pathToFileURL, fileURLToPath } from "bun";
describe("pathToFileURL", () => {
it("should convert a path to a file url", () => {
expect(pathToFileURL("/path/to/file.js").href).toBe(
- "file:///path/to/file.js"
+ "file:///path/to/file.js",
);
});
});
@@ -14,7 +14,7 @@ describe("fileURLToPath", () => {
});
it("should convert a URL to a path", () => {
expect(fileURLToPath(new URL("file:///path/to/file.js"))).toBe(
- "/path/to/file.js"
+ "/path/to/file.js",
);
});
});
diff --git a/test/bun.js/filesink.test.ts b/test/bun.js/filesink.test.ts
index 28d51a173..b3b3a7e74 100644
--- a/test/bun.js/filesink.test.ts
+++ b/test/bun.js/filesink.test.ts
@@ -11,14 +11,14 @@ describe("FileSink", () => {
[
["abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"],
new TextEncoder().encode(
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
),
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
],
[
["😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"],
new TextEncoder().encode(
- "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"
+ "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
),
"😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
],
@@ -29,7 +29,7 @@ describe("FileSink", () => {
],
new TextEncoder().encode(
"abcdefghijklmnopqrstuvwxyz" +
- "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"
+ "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
),
"abcdefghijklmnopqrstuvwxyz" +
"😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
@@ -43,7 +43,7 @@ describe("FileSink", () => {
],
new TextEncoder().encode(
"abcdefghijklmnopqrstuvwxyz" +
- "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"
+ "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
),
"(rope) " +
"abcdefghijklmnopqrstuvwxyz" +
@@ -58,13 +58,13 @@ describe("FileSink", () => {
],
new TextEncoder().encode(
"abcdefghijklmnopqrstuvwxyz" +
- "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌"
+ "😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
),
"(array) " +
"abcdefghijklmnopqrstuvwxyz" +
"😋 Get Emoji — All Emojis to ✂️ Copy and 📋 Paste 👌",
],
- ];
+ ] as const;
for (const [input, expected, label] of fixtures) {
it(`${JSON.stringify(label)}`, async () => {
diff --git a/test/bun.js/fs-stream.js b/test/bun.js/fs-stream.js
index 4b71c95b7..1ef3ee71c 100644
--- a/test/bun.js/fs-stream.js
+++ b/test/bun.js/fs-stream.js
@@ -10,7 +10,7 @@ await new Promise((resolve, reject) => {
const real = readFileSync("/tmp/fs-stream.js", "utf8");
if (copied !== real) {
reject(
- new Error("fs-stream.js is not the same as fs-stream.copy.js")
+ new Error("fs-stream.js is not the same as fs-stream.copy.js"),
);
return;
}
diff --git a/test/bun.js/fs.test.js b/test/bun.js/fs.test.js
index 3976ba372..5c80505ef 100644
--- a/test/bun.js/fs.test.js
+++ b/test/bun.js/fs.test.js
@@ -1,5 +1,5 @@
import { describe, expect, it } from "bun:test";
-import { gc, gcTick } from "gc";
+import { gc, gcTick } from "./gc";
import {
closeSync,
existsSync,
@@ -31,14 +31,14 @@ describe("copyFileSync", () => {
const tempdir = `/tmp/fs.test.js/${Date.now()}/1234/hi`;
expect(existsSync(tempdir)).toBe(false);
expect(tempdir.includes(mkdirSync(tempdir, { recursive: true }))).toBe(
- true
+ true,
);
// that don't exist
copyFileSync(import.meta.path, tempdir + "/copyFileSync.js");
expect(existsSync(tempdir + "/copyFileSync.js")).toBe(true);
expect(readFileSync(tempdir + "/copyFileSync.js", "utf-8")).toBe(
- readFileSync(import.meta.path, "utf-8")
+ readFileSync(import.meta.path, "utf-8"),
);
// that do exist
@@ -53,7 +53,7 @@ describe("copyFileSync", () => {
const tempdir = `/tmp/fs.test.js/${Date.now()}-1/1234/hi`;
expect(existsSync(tempdir)).toBe(false);
expect(tempdir.includes(mkdirSync(tempdir, { recursive: true }))).toBe(
- true
+ true,
);
var buffer = new Int32Array(128 * 1024);
for (let i = 0; i < buffer.length; i++) {
@@ -67,20 +67,20 @@ describe("copyFileSync", () => {
expect(existsSync(tempdir + "/copyFileSync.src.blob")).toBe(true);
copyFileSync(
tempdir + "/copyFileSync.src.blob",
- tempdir + "/copyFileSync.dest.blob"
+ tempdir + "/copyFileSync.dest.blob",
);
expect(Bun.hash(readFileSync(tempdir + "/copyFileSync.dest.blob"))).toBe(
- hash
+ hash,
);
buffer[0] = 255;
writeFileSync(tempdir + "/copyFileSync.src.blob", buffer.buffer);
copyFileSync(
tempdir + "/copyFileSync.src.blob",
- tempdir + "/copyFileSync.dest.blob"
+ tempdir + "/copyFileSync.dest.blob",
);
expect(Bun.hash(readFileSync(tempdir + "/copyFileSync.dest.blob"))).toBe(
- Bun.hash(buffer.buffer)
+ Bun.hash(buffer.buffer),
);
});
});
@@ -90,7 +90,7 @@ describe("mkdirSync", () => {
const tempdir = `/tmp/fs.test.js/${Date.now()}/1234/hi`;
expect(existsSync(tempdir)).toBe(false);
expect(tempdir.includes(mkdirSync(tempdir, { recursive: true }))).toBe(
- true
+ true,
);
expect(existsSync(tempdir)).toBe(true);
});
@@ -134,7 +134,7 @@ it("readdirSync works on empty directories", () => {
it("readdirSync works on directories with under 32 files", () => {
const path = `/tmp/fs-test-one-dir-${(Math.random() * 100000 + 100).toString(
- 32
+ 32,
)}`;
mkdirSync(path, { recursive: true });
writeFileSync(`${path}/a`, "a");
@@ -172,7 +172,7 @@ it("readdirSync throws when given a file path with trailing slash", () => {
describe("readSync", () => {
const firstFourBytes = new Uint32Array(
- new TextEncoder().encode("File").buffer
+ new TextEncoder().encode("File").buffer,
)[0];
it("works with a position set to 0", () => {
const fd = openSync(import.meta.dir + "/readFileSync.txt", "r");
@@ -234,7 +234,7 @@ describe("readFileSync", () => {
gc();
const text = readFileSync(
new URL("file://" + import.meta.dir + "/readFileSync.txt"),
- "utf8"
+ "utf8",
);
gc();
expect(text).toBe("File read successfully");
@@ -338,7 +338,7 @@ describe("lstat", () => {
const fileStats = lstatSync(
new URL("./fs-stream.js", import.meta.url)
.toString()
- .slice("file://".length - 1)
+ .slice("file://".length - 1),
);
expect(fileStats.isSymbolicLink()).toBe(false);
expect(fileStats.isFile()).toBe(true);
@@ -349,7 +349,7 @@ describe("lstat", () => {
const fileStats = lstatSync(
new URL("../../test", import.meta.url)
.toString()
- .slice("file://".length - 1)
+ .slice("file://".length - 1),
);
expect(fileStats.isSymbolicLink()).toBe(false);
expect(fileStats.isFile()).toBe(false);
@@ -360,7 +360,7 @@ describe("lstat", () => {
const linkStats = lstatSync(
new URL("./fs-stream.link.js", import.meta.url)
.toString()
- .slice("file://".length - 1)
+ .slice("file://".length - 1),
);
expect(linkStats.isSymbolicLink()).toBe(true);
expect(linkStats.isFile()).toBe(false);
@@ -373,7 +373,7 @@ describe("stat", () => {
const fileStats = statSync(
new URL("./fs-stream.js", import.meta.url)
.toString()
- .slice("file://".length - 1)
+ .slice("file://".length - 1),
);
expect(fileStats.isSymbolicLink()).toBe(false);
expect(fileStats.isFile()).toBe(true);
@@ -384,7 +384,7 @@ describe("stat", () => {
const fileStats = statSync(
new URL("../../test", import.meta.url)
.toString()
- .slice("file://".length - 1)
+ .slice("file://".length - 1),
);
expect(fileStats.isSymbolicLink()).toBe(false);
expect(fileStats.isFile()).toBe(false);
@@ -478,7 +478,7 @@ describe("createWriteStream", () => {
stream.on("finish", () => {
expect(readFileSync(path, "utf8")).toBe(
- "Test file written successfully"
+ "Test file written successfully",
);
resolve(true);
});
diff --git a/test/bun.js/html-rewriter.test.js b/test/bun.js/html-rewriter.test.js
index 29b765c2f..008ced791 100644
--- a/test/bun.js/html-rewriter.test.js
+++ b/test/bun.js/html-rewriter.test.js
@@ -74,11 +74,11 @@ describe("HTMLRewriter", () => {
},
});
var input = new Response(
- '<div first second="alrihgt" third="123" fourth=5 fifth=helloooo>hello</div>'
+ '<div first second="alrihgt" third="123" fourth=5 fifth=helloooo>hello</div>',
);
var output = rewriter.transform(input);
expect(await output.text()).toBe(
- '<div first second="alrihgt" third="123" fourth=5 fifth=helloooo>hello</div>'
+ '<div first second="alrihgt" third="123" fourth=5 fifth=helloooo>hello</div>',
);
expect(expected.length).toBe(0);
});
@@ -104,7 +104,7 @@ describe("HTMLRewriter", () => {
"&lt;span&gt;append&lt;/span&gt;",
"<span>append html</span>",
"</p>",
- ].join("")
+ ].join(""),
);
// setInnerContent
@@ -202,92 +202,92 @@ describe("HTMLRewriter", () => {
await checkSelector(
"p:nth-child(2)",
"<div><p>1</p><p>2</p><p>3</p></div>",
- "<div><p>1</p><p>new</p><p>3</p></div>"
+ "<div><p>1</p><p>new</p><p>3</p></div>",
);
await checkSelector(
"p:first-child",
"<div><p>1</p><p>2</p><p>3</p></div>",
- "<div><p>new</p><p>2</p><p>3</p></div>"
+ "<div><p>new</p><p>2</p><p>3</p></div>",
);
await checkSelector(
"p:nth-of-type(2)",
"<div><p>1</p><h1>2</h1><p>3</p><h1>4</h1><p>5</p></div>",
- "<div><p>1</p><h1>2</h1><p>new</p><h1>4</h1><p>5</p></div>"
+ "<div><p>1</p><h1>2</h1><p>new</p><h1>4</h1><p>5</p></div>",
);
await checkSelector(
"p:first-of-type",
"<div><h1>1</h1><p>2</p><p>3</p></div>",
- "<div><h1>1</h1><p>new</p><p>3</p></div>"
+ "<div><h1>1</h1><p>new</p><p>3</p></div>",
);
await checkSelector(
"p:not(:first-child)",
"<div><p>1</p><p>2</p><p>3</p></div>",
- "<div><p>1</p><p>new</p><p>new</p></div>"
+ "<div><p>1</p><p>new</p><p>new</p></div>",
);
await checkSelector(
"p.red",
'<p class="red">1</p><p>2</p>',
- '<p class="red">new</p><p>2</p>'
+ '<p class="red">new</p><p>2</p>',
);
await checkSelector(
"h1#header",
'<h1 id="header">1</h1><h1>2</h1>',
- '<h1 id="header">new</h1><h1>2</h1>'
+ '<h1 id="header">new</h1><h1>2</h1>',
);
await checkSelector(
"p[data-test]",
"<p data-test>1</p><p>2</p>",
- "<p data-test>new</p><p>2</p>"
+ "<p data-test>new</p><p>2</p>",
);
await checkSelector(
'p[data-test="one"]',
'<p data-test="one">1</p><p data-test="two">2</p>',
- '<p data-test="one">new</p><p data-test="two">2</p>'
+ '<p data-test="one">new</p><p data-test="two">2</p>',
);
await checkSelector(
'p[data-test="one" i]',
'<p data-test="one">1</p><p data-test="OnE">2</p><p data-test="two">3</p>',
- '<p data-test="one">new</p><p data-test="OnE">new</p><p data-test="two">3</p>'
+ '<p data-test="one">new</p><p data-test="OnE">new</p><p data-test="two">3</p>',
);
await checkSelector(
'p[data-test="one" s]',
'<p data-test="one">1</p><p data-test="OnE">2</p><p data-test="two">3</p>',
- '<p data-test="one">new</p><p data-test="OnE">2</p><p data-test="two">3</p>'
+ '<p data-test="one">new</p><p data-test="OnE">2</p><p data-test="two">3</p>',
);
await checkSelector(
'p[data-test~="two"]',
'<p data-test="one two three">1</p><p data-test="one two">2</p><p data-test="one">3</p>',
- '<p data-test="one two three">new</p><p data-test="one two">new</p><p data-test="one">3</p>'
+ '<p data-test="one two three">new</p><p data-test="one two">new</p><p data-test="one">3</p>',
);
await checkSelector(
'p[data-test^="a"]',
'<p data-test="a1">1</p><p data-test="a2">2</p><p data-test="b1">3</p>',
- '<p data-test="a1">new</p><p data-test="a2">new</p><p data-test="b1">3</p>'
+ '<p data-test="a1">new</p><p data-test="a2">new</p><p data-test="b1">3</p>',
);
await checkSelector(
'p[data-test$="1"]',
'<p data-test="a1">1</p><p data-test="a2">2</p><p data-test="b1">3</p>',
- '<p data-test="a1">new</p><p data-test="a2">2</p><p data-test="b1">new</p>'
+ '<p data-test="a1">new</p><p data-test="a2">2</p><p data-test="b1">new</p>',
);
await checkSelector(
'p[data-test*="b"]',
'<p data-test="abc">1</p><p data-test="ab">2</p><p data-test="a">3</p>',
- '<p data-test="abc">new</p><p data-test="ab">new</p><p data-test="a">3</p>'
+ '<p data-test="abc">new</p><p data-test="ab">new</p><p data-test="a">3</p>',
);
await checkSelector(
'p[data-test|="a"]',
'<p data-test="a">1</p><p data-test="a-1">2</p><p data-test="a2">3</p>',
- '<p data-test="a">new</p><p data-test="a-1">new</p><p data-test="a2">3</p>'
+ '<p data-test="a">new</p><p data-test="a-1">new</p><p data-test="a2">3</p>',
);
await checkSelector(
"div span",
"<div><h1><span>1</span></h1><span>2</span><b>3</b></div>",
- "<div><h1><span>new</span></h1><span>new</span><b>3</b></div>"
+ "<div><h1><span>new</span></h1><span>new</span><b>3</b></div>",
);
await checkSelector(
"div > span",
"<div><h1><span>1</span></h1><span>2</span><b>3</b></div>",
- "<div><h1><span>1</span></h1><span>new</span><b>3</b></div>"
+ "<div><h1><span>1</span></h1><span>new</span><b>3</b></div>",
);
});
});
diff --git a/test/bun.js/import-meta.test.js b/test/bun.js/import-meta.test.js
index a1ead978e..a6d663061 100644
--- a/test/bun.js/import-meta.test.js
+++ b/test/bun.js/import-meta.test.js
@@ -10,7 +10,7 @@ it("primordials are not here!", () => {
it("import.meta.resolveSync", () => {
expect(
- import.meta.resolveSync("./" + import.meta.file, import.meta.path)
+ import.meta.resolveSync("./" + import.meta.file, import.meta.path),
).toBe(path);
const require = Module.createRequire(import.meta.path);
expect(require.resolve(import.meta.path)).toBe(path);
@@ -18,7 +18,7 @@ it("import.meta.resolveSync", () => {
// check it works with URL objects
expect(
- Module.createRequire(new URL(import.meta.url)).resolve(import.meta.path)
+ Module.createRequire(new URL(import.meta.url)).resolve(import.meta.path),
).toBe(import.meta.path);
});
diff --git a/test/bun.js/inspect.test.js b/test/bun.js/inspect.test.js
index 65ba67edf..b49265f53 100644
--- a/test/bun.js/inspect.test.js
+++ b/test/bun.js/inspect.test.js
@@ -34,7 +34,7 @@ it("utf16 property name", () => {
var { Database } = require("bun:sqlite");
const db = Database.open(":memory:");
expect(Bun.inspect(db.prepare("select '😀' as 笑").all())).toBe(
- '[ { "笑": "😀" } ]'
+ '[ { "笑": "😀" } ]',
);
});
@@ -53,7 +53,7 @@ it("Request object", () => {
Request (0 KB) {
method: "GET",
url: "https://example.com"
-}`.trim()
+}`.trim(),
);
});
@@ -62,7 +62,7 @@ it("MessageEvent", () => {
`MessageEvent {
type: "message",
data: 123
-}`
+}`,
);
});
@@ -83,13 +83,13 @@ it("TypedArray prints", () => {
const input = Bun.inspect(buffer);
expect(input).toBe(
- `${TypedArray.name}(${buffer.length}) [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]`
+ `${TypedArray.name}(${buffer.length}) [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]`,
);
for (let i = 1; i < buffer.length + 1; i++) {
expect(Bun.inspect(buffer.subarray(i))).toBe(
`${TypedArray.name}(${buffer.length - i}) [ ` +
[...buffer.subarray(i)].join(", ") +
- " ]"
+ " ]",
);
}
}
@@ -101,13 +101,13 @@ it("BigIntArray", () => {
const input = Bun.inspect(buffer);
expect(input).toBe(
- `${TypedArray.name}(${buffer.length}) [ 1n, 2n, 3n, 4n, 5n, 6n, 7n, 8n, 9n, 10n ]`
+ `${TypedArray.name}(${buffer.length}) [ 1n, 2n, 3n, 4n, 5n, 6n, 7n, 8n, 9n, 10n ]`,
);
for (let i = 1; i < buffer.length + 1; i++) {
expect(Bun.inspect(buffer.subarray(i))).toBe(
`${TypedArray.name}(${buffer.length - i}) [ ` +
[...buffer.subarray(i)].map((a) => a.toString(10) + "n").join(", ") +
- " ]"
+ " ]",
);
}
}
@@ -120,14 +120,14 @@ it("FloatArray", () => {
expect(input).toBe(
`${TypedArray.name}(${buffer.length}) [ ${[Math.fround(42.68)].join(
- ", "
- )} ]`
+ ", ",
+ )} ]`,
);
for (let i = 1; i < buffer.length + 1; i++) {
expect(Bun.inspect(buffer.subarray(i))).toBe(
`${TypedArray.name}(${buffer.length - i}) [ ` +
[...buffer.subarray(i)].join(", ") +
- " ]"
+ " ]",
);
}
}
@@ -138,7 +138,7 @@ it("jsx with two elements", () => {
<div hello="quoted">
<input type="text" value={"123"} />
string inside child
- </div>
+ </div>,
);
const output = `<div hello="quoted">
@@ -169,7 +169,7 @@ it("jsx with fragment", () => {
it("inspect", () => {
expect(Bun.inspect(new TypeError("what")).includes("TypeError: what")).toBe(
- true
+ true,
);
expect("hi").toBe("hi");
expect(Bun.inspect(1)).toBe("1");
@@ -182,10 +182,10 @@ it("inspect", () => {
expect(Bun.inspect({ hello: 1 })).toBe("{ hello: 1 }");
expect(Bun.inspect({ hello: 1, there: 2 })).toBe("{ hello: 1, there: 2 }");
expect(Bun.inspect({ hello: "1", there: 2 })).toBe(
- '{ hello: "1", there: 2 }'
+ '{ hello: "1", there: 2 }',
);
expect(Bun.inspect({ 'hello-"there': "1", there: 2 })).toBe(
- '{ "hello-\\"there": "1", there: 2 }'
+ '{ "hello-\\"there": "1", there: 2 }',
);
var str = "123";
while (str.length < 4096) {
@@ -204,29 +204,29 @@ it("inspect", () => {
expect(Bun.inspect(new Set())).toBe("Set {}");
expect(Bun.inspect(new Map())).toBe("Map {}");
expect(Bun.inspect(new Map([["foo", "bar"]]))).toBe(
- 'Map(1) {\n "foo": "bar",\n}'
+ 'Map(1) {\n "foo": "bar",\n}',
);
expect(Bun.inspect(new Set(["bar"]))).toBe('Set(1) {\n "bar",\n}');
expect(Bun.inspect(<div>foo</div>)).toBe("<div>foo</div>");
expect(Bun.inspect(<div hello>foo</div>)).toBe("<div hello=true>foo</div>");
expect(Bun.inspect(<div hello={1}>foo</div>)).toBe("<div hello=1>foo</div>");
expect(Bun.inspect(<div hello={123}>hi</div>)).toBe(
- "<div hello=123>hi</div>"
+ "<div hello=123>hi</div>",
);
expect(Bun.inspect(<div hello="quoted">quoted</div>)).toBe(
- '<div hello="quoted">quoted</div>'
+ '<div hello="quoted">quoted</div>',
);
expect(
Bun.inspect(
<div hello="quoted">
<input type="text" value={"123"} />
- </div>
- )
+ </div>,
+ ),
).toBe(
`
<div hello="quoted">
<input type="text" value="123" />
-</div>`.trim()
+</div>`.trim(),
);
expect(Bun.inspect(BigInt(32))).toBe("32n");
});
diff --git a/test/bun.js/log-test.test.ts b/test/bun.js/log-test.test.ts
index bdb6cbe42..272dc7ef2 100644
--- a/test/bun.js/log-test.test.ts
+++ b/test/bun.js/log-test.test.ts
@@ -14,7 +14,7 @@ it("should not log .env when quiet", async () => {
cwd: "/tmp/log-test-silent",
});
- expect(stderr.toString()).toBe("");
+ expect(stderr!.toString()).toBe("");
});
it("should log .env by default", async () => {
@@ -29,7 +29,7 @@ it("should log .env by default", async () => {
cwd: "/tmp/log-test-silent",
});
- expect(stderr.toString().includes(".env")).toBe(true);
+ expect(stderr?.toString().includes(".env")).toBe(true);
});
function writeDirectoryTree(base, paths) {
diff --git a/test/bun.js/microtask.test.js b/test/bun.js/microtask.test.js
index 18956b1e5..dba84f36c 100644
--- a/test/bun.js/microtask.test.js
+++ b/test/bun.js/microtask.test.js
@@ -60,7 +60,7 @@ it("queueMicrotask", async () => {
if (!passed)
throw new Error(
- "queueMicrotask should throw a TypeError if the argument is not a function"
+ "queueMicrotask should throw a TypeError if the argument is not a function",
);
}
@@ -74,7 +74,7 @@ it("queueMicrotask", async () => {
if (!passed)
throw new Error(
- "queueMicrotask should throw a TypeError if the argument is empty"
+ "queueMicrotask should throw a TypeError if the argument is empty",
);
}
});
diff --git a/test/bun.js/node-test-helpers.test.js b/test/bun.js/node-test-helpers.test.js
index 7fb2de320..766dfc176 100644
--- a/test/bun.js/node-test-helpers.test.js
+++ b/test/bun.js/node-test-helpers.test.js
@@ -5,7 +5,7 @@ import {
strictEqual,
createCallCheckCtx,
createDoneDotAll,
-} from "node-test-helpers";
+} from "./node-test-helpers";
describe("OurAssert.throws()", () => {
it("should pass when the function throws", () => {
diff --git a/test/bun.js/oniguruma-regexp.test.ts b/test/bun.js/oniguruma-regexp.test.ts
index 372e8eb99..9fe3d7be8 100644
--- a/test/bun.js/oniguruma-regexp.test.ts
+++ b/test/bun.js/oniguruma-regexp.test.ts
@@ -1,3 +1,4 @@
+// @ts-ignore
import { OnigurumaRegExp } from "bun";
import { expect, it, test } from "bun:test";
import { gc as gcTrace } from "./gc";
@@ -7,8 +8,8 @@ it("repeated match and exec calls", () => {
let r1 = new OnigurumaRegExp("//.+?/[^?]+", "sg");
let r2 = new RegExp("//.+?/[^?]+", "sg");
let s1 = "https://dylan-conway.com/profile";
- expect(s1.match(r1)[0] === s1.match(r2)[0]).toBe(true);
- expect(r1.exec(s1)[0] === r2.exec(s1)[0]).toBe(true);
+ expect(s1.match(r1)![0] === s1.match(r2)![0]).toBe(true);
+ expect(r1.exec(s1)![0] === r2.exec(s1)![0]).toBe(true);
}
});
@@ -17,8 +18,8 @@ it("repeated match and exec calls no global flag", () => {
let r1 = new OnigurumaRegExp("//.+?/[^?]+", "s");
let r2 = new RegExp("//.+?/[^?]+", "s");
let s1 = "https://dylan-conway.com/profile";
- expect(r1.exec(s1)[0] === r2.exec(s1)[0]).toBe(true);
- expect(s1.match(r1)[0] === s1.match(r2)[0]).toBe(true);
+ expect(r1.exec(s1)![0] === r2.exec(s1)![0]).toBe(true);
+ expect(s1.match(r1)![0] === s1.match(r2)![0]).toBe(true);
}
});
@@ -27,53 +28,53 @@ const rb2 = new RegExp("//.+?/[^?]+", "s");
it("repeated match calls with global regex without global flag", () => {
for (let i = 0; i < 20000; i++) {
let s1 = "https://dylan-conway.com/profile";
- expect(rb1.exec(s1)[0] === rb2.exec(s1)[0]).toBe(true);
- expect(s1.match(rb1)[0] === s1.match(rb2)[0]).toBe(true);
+ expect(rb1.exec(s1)![0] === rb2.exec(s1)![0]).toBe(true);
+ expect(s1.match(rb1)![0] === s1.match(rb2)![0]).toBe(true);
}
});
it("escaped characters in character classes", () => {
expect(
- new RegExp("[a-z]").exec("a")[0] ===
- new OnigurumaRegExp("[a-z]").exec("a")[0]
+ new RegExp("[a-z]").exec("a")![0] ===
+ new OnigurumaRegExp("[a-z]").exec("a")![0],
).toBe(true);
Bun.gc(true);
expect(
- new RegExp("[a-z]").exec("b")[0] ===
- new OnigurumaRegExp("[a-z]").exec("b")[0]
+ new RegExp("[a-z]").exec("b")![0] ===
+ new OnigurumaRegExp("[a-z]").exec("b")![0],
).toBe(true);
Bun.gc(true);
- expect(new RegExp("[a-zA-Z0-9_]+").exec("B9")[0]).toBe(
- new OnigurumaRegExp("[a-zA-Z0-9_]+").exec("B9")[0]
+ expect(new RegExp("[a-zA-Z0-9_]+").exec("B9")![0]).toBe(
+ new OnigurumaRegExp("[a-zA-Z0-9_]+").exec("B9")![0],
);
Bun.gc(true);
expect(new RegExp("[a-z]").exec("-")).toBe(null);
Bun.gc(true);
expect(new OnigurumaRegExp("[a-z]").exec("-")).toBe(null);
Bun.gc(true);
- expect(new RegExp("[a\\-z]").exec("-")[0]).toBe("-");
+ expect(new RegExp("[a\\-z]").exec("-")![0]).toBe("-");
Bun.gc(true);
- expect(new OnigurumaRegExp("[a\\-z]").exec("-")[0]).toBe("-");
+ expect(new OnigurumaRegExp("[a\\-z]").exec("-")![0]).toBe("-");
Bun.gc(true);
- expect(new RegExp("[a\\-z]").exec("a")[0]).toBe("a");
+ expect(new RegExp("[a\\-z]").exec("a")![0]).toBe("a");
Bun.gc(true);
- expect(new OnigurumaRegExp("[a\\-z]").exec("a")[0]).toBe("a");
+ expect(new OnigurumaRegExp("[a\\-z]").exec("a")![0]).toBe("a");
Bun.gc(true);
- expect(new RegExp("[a\\-z]").exec("z")[0]).toBe("z");
+ expect(new RegExp("[a\\-z]").exec("z")![0]).toBe("z");
Bun.gc(true);
- expect(new OnigurumaRegExp("[a\\-z]").exec("z")[0]).toBe("z");
+ expect(new OnigurumaRegExp("[a\\-z]").exec("z")![0]).toBe("z");
Bun.gc(true);
expect(new RegExp("[a\\-z]").exec("b")).toBe(null);
Bun.gc(true);
expect(new OnigurumaRegExp("[a\\-z]").exec("b")).toBe(null);
Bun.gc(true);
- expect(new RegExp("[^b-c]").exec("a")[0]).toBe(
- new OnigurumaRegExp("[^b-c]").exec("a")[0]
+ expect(new RegExp("[^b-c]").exec("a")![0]).toBe(
+ new OnigurumaRegExp("[^b-c]").exec("a")![0],
);
Bun.gc(true);
@@ -81,16 +82,16 @@ it("escaped characters in character classes", () => {
expect(new OnigurumaRegExp("[\\^b-c]").exec("a")).toBe(null);
Bun.gc(true);
- expect(new RegExp("[\\^b-c]").exec("^c")[0]).toBe("^");
- expect(new OnigurumaRegExp("[\\^b-c]").exec("^c")[0]).toBe("^");
+ expect(new RegExp("[\\^b-c]").exec("^c")![0]).toBe("^");
+ expect(new OnigurumaRegExp("[\\^b-c]").exec("^c")![0]).toBe("^");
Bun.gc(true);
- expect(new RegExp("[a^b-c]").exec("a^")[0]).toBe("a");
- expect(new OnigurumaRegExp("[a^b-c]").exec("a^")[0]).toBe("a");
+ expect(new RegExp("[a^b-c]").exec("a^")![0]).toBe("a");
+ expect(new OnigurumaRegExp("[a^b-c]").exec("a^")![0]).toBe("a");
Bun.gc(true);
- expect(new RegExp("[\\\\]").exec("\\")[0]).toBe("\\");
- expect(new OnigurumaRegExp("[\\\\]").exec("\\")[0]).toBe("\\");
+ expect(new RegExp("[\\\\]").exec("\\")![0]).toBe("\\");
+ expect(new OnigurumaRegExp("[\\\\]").exec("\\")![0]).toBe("\\");
Bun.gc(true);
let p = "//.+?[^?]+";
@@ -98,15 +99,15 @@ it("escaped characters in character classes", () => {
const b1 = new RegExp(p, "gs");
const b2 = new OnigurumaRegExp(p, "gs");
Bun.gc(true);
- expect(s.match(b1)[0] === s.match(b2)[0]).toBe(true);
+ expect(s.match(b1)![0] === s.match(b2)![0]).toBe(true);
Bun.gc(true);
const b3 = new RegExp("[\\^]");
const b4 = new OnigurumaRegExp("[\\^]");
Bun.gc(true);
expect(
- "https://dylan-co^nway.com/profile".match(b3)[0] ===
- "https://dylan-co^nway.com/profile".match(b4)[0]
+ "https://dylan-co^nway.com/profile".match(b3)![0] ===
+ "https://dylan-co^nway.com/profile".match(b4)![0],
).toBe(true);
Bun.gc(true);
@@ -114,132 +115,132 @@ it("escaped characters in character classes", () => {
p = "\/\/.+?\/[^?]+";
s = "https://dylan-conway.com/profile";
Bun.gc(true);
- expect(s.match(new OnigurumaRegExp(p, "gs"))[0]).toBe(
- new RegExp(p, "gs").exec(s)[0]
+ expect(s.match(new OnigurumaRegExp(p, "gs"))![0]).toBe(
+ new RegExp(p, "gs").exec(s)![0],
);
Bun.gc(true);
// middle no escape
p = "[.i^e]+";
s = "https://dylan-co^nway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
// middle with escape
p = "[.i\\^e]+";
s = "https://dylan-co^nway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
// end with escape
p = "[.ie\\^]+";
s = "https://dylan-co^nway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
// end no escape
p = "[.ie^]+";
s = "https://dylan-co^nway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
// start no escape
p = "[^.ie]+";
s = "https://dylan-co^nway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
// start with escape
p = "[\\^.ie]+";
s = "https://dylan-co^nway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
// middle with escape
p = "[.i\\-e]+";
s = "https://dylan-conway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
// end with escape
p = "[.ie\\-]+";
s = "https://dylan-conway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
// end no escape
p = "[.ie-]+";
s = "https://dylan-conway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
// start no escape
p = "[-.ie]+";
s = "https://dylan-conway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
// start with escape
p = "[\\-.ie]+";
s = "https://dylan-conway.com/profile";
- expect(new OnigurumaRegExp(p).exec(s)[0]).toBe(new RegExp(p).exec(s)[0]);
+ expect(new OnigurumaRegExp(p).exec(s)![0]).toBe(new RegExp(p).exec(s)![0]);
- let r1 = new RegExp("^([[(]-?[\\d]+)?,?(-?[\\d]+[\\])])?$").exec("(1,1]");
+ let r1 = new RegExp("^([[(]-?[\\d]+)?,?(-?[\\d]+[\\])])?$").exec("(1,1]")!;
Bun.gc(true);
let r2 = new OnigurumaRegExp("^([[(]-?[\\d]+)?,?(-?[\\d]+[\\])])?$").exec(
- "(1,1]"
+ "(1,1]",
);
Bun.gc(true);
expect(r1[0]).toBe(r2[0]);
Bun.gc(true);
- let r3 = new RegExp("[\\d],[\\d]").exec("1,2");
+ let r3 = new RegExp("[\\d],[\\d]").exec("1,2")!;
let r4 = new OnigurumaRegExp("[\\d],[\\d]").exec("1,2");
expect(r3[0]).toBe(r4[0]);
- let r5 = new RegExp("^[(],[)]?$").exec("(,");
+ let r5 = new RegExp("^[(],[)]?$").exec("(,")!;
let r6 = new OnigurumaRegExp("^[(],[)]?$").exec("(,");
expect(r5[0]).toBe(r6[0]);
- let r9 = new RegExp("[([],[)\\]]").exec("[,]");
+ let r9 = new RegExp("[([],[)\\]]").exec("[,]")!;
let r10 = new OnigurumaRegExp("[([],[)\\]]").exec("[,]");
expect(r9[0]).toBe(r10[0]);
- let r13 = new RegExp("\\[").exec("[");
+ let r13 = new RegExp("\\[").exec("[")!;
let r14 = new OnigurumaRegExp("\\[").exec("[");
expect(r13[0]).toBe(r14[0]);
- let r15 = new RegExp("\\]").exec("]");
+ let r15 = new RegExp("\\]").exec("]")!;
let r16 = new OnigurumaRegExp("\\]").exec("]");
expect(r15[0]).toBe(r16[0]);
- let r17 = new RegExp("]").exec("]");
+ let r17 = new RegExp("]").exec("]")!;
let r18 = new OnigurumaRegExp("]").exec("]");
expect(r17[0]).toBe(r18[0]);
- let r21 = new RegExp("[\\]]").exec("]");
+ let r21 = new RegExp("[\\]]").exec("]")!;
let r22 = new OnigurumaRegExp("[\\]]").exec("]");
expect(r21[0]).toBe(r22[0]);
- let r23 = new RegExp("[\\[]").exec("[");
+ let r23 = new RegExp("[\\[]").exec("[")!;
let r24 = new OnigurumaRegExp("[\\[]").exec("[");
expect(r23[0]).toBe(r24[0]);
- let r25 = new RegExp("[[][[]").exec("[[");
+ let r25 = new RegExp("[[][[]").exec("[[")!;
let r26 = new OnigurumaRegExp("[[][[]").exec("[[");
expect(r25[0]).toBe(r26[0]);
- let r27 = new RegExp("[[\\]][[\\]]").exec("[]");
+ let r27 = new RegExp("[[\\]][[\\]]").exec("[]")!;
let r28 = new OnigurumaRegExp("[[\\]][[\\]]").exec("[]");
expect(r27[0]).toBe(r28[0]);
- let r29 = new RegExp("[[\\]][[\\]]").exec("][");
+ let r29 = new RegExp("[[\\]][[\\]]").exec("][")!;
let r30 = new OnigurumaRegExp("[[\\]][[\\]]").exec("][");
expect(r29[0]).toBe(r30[0]);
- let r31 = new RegExp("[[\\]][[\\]]").exec("]]");
+ let r31 = new RegExp("[[\\]][[\\]]").exec("]]")!;
let r32 = new OnigurumaRegExp("[[\\]][[\\]]").exec("]]");
expect(r31[0]).toBe(r32[0]);
- let r33 = new RegExp("[\\]][\\]]").exec("]]");
+ let r33 = new RegExp("[\\]][\\]]").exec("]]")!;
let r34 = new OnigurumaRegExp("[\\]][\\]]").exec("]]");
expect(r33[0]).toBe(r34[0]);
- let r35 = new RegExp("[a-z&&[^aeiou]").exec("a");
+ let r35 = new RegExp("[a-z&&[^aeiou]").exec("a")!;
let r36 = new OnigurumaRegExp("[a-z&&[^aeiou]").exec("a");
expect(r35[0]).toBe(r36[0]);
- let r37 = new RegExp("[a-z&&[^aeiou]]").exec("a]");
+ let r37 = new RegExp("[a-z&&[^aeiou]]").exec("a]")!;
let r38 = new OnigurumaRegExp("[a-z&&[^aeiou]]").exec("a]");
expect(r37[0]).toBe(r38[0]);
});
@@ -251,7 +252,7 @@ it("OnigurumaRegExp.prototype.exec()", () => {
let a2 = new RegExp("\x3e", "gd");
let a2_1 = a2.exec("table fo\x3eotball, fo\x3eosball");
- a2_1 = a2.exec("table fo\x3eotball, fo\x3eosball");
+ a2_1 = a2.exec("table fo\x3eotball, fo\x3eosball")!;
expect(a1_1[0]).toBe(a2_1[0]);
expect(a1_1[1]).toBe(a2_1[1]);
@@ -259,7 +260,9 @@ it("OnigurumaRegExp.prototype.exec()", () => {
expect(a1_1.input).toBe(a2_1.input);
expect(a1.lastIndex).toBe(a2.lastIndex);
expect(a1_1.groups).toBe(a2_1.groups);
+ // @ts-ignore remove when `indices` is added to lib/dom
expect(a1_1.indices[0][0]).toBe(a2_1.indices[0][0]);
+ // @ts-ignore
expect(a1_1.indices[0][1]).toBe(a2_1.indices[0][1]);
});
@@ -269,8 +272,8 @@ test("OnigurumaRegExp.prototype.exec() 2", () => {
a1_1 = a1.exec("table fo\x3e\x5eotball, fo\x3e\x5eosball");
let a2 = new RegExp("\x3e\\x5e", "gd");
- let a2_1 = a2.exec("table fo\x3e\x5eotball, fo\x3e\x5eosball");
- a2_1 = a2.exec("table fo\x3e\x5eotball, fo\x3e\x5eosball");
+ let a2_1 = a2.exec("table fo\x3e\x5eotball, fo\x3e\x5eosball")!;
+ a2_1 = a2.exec("table fo\x3e\x5eotball, fo\x3e\x5eosball")!;
expect(a1_1[0]).toBe(a2_1[0]);
expect(a1_1[1]).toBe(a2_1[1]);
@@ -278,7 +281,9 @@ test("OnigurumaRegExp.prototype.exec() 2", () => {
expect(a1_1.input).toBe(a2_1.input);
expect(a1.lastIndex).toBe(a2.lastIndex);
expect(a1_1.groups).toBe(a2_1.groups);
+ // @ts-ignore
expect(a1_1.indices[0][0]).toBe(a2_1.indices[0][0]);
+ // @ts-ignore
expect(a1_1.indices[0][1]).toBe(a2_1.indices[0][1]);
});
@@ -291,7 +296,7 @@ test("OnigurumaRegExp.prototype.exec() 3", () => {
let a1_1 = a1.exec("table fo\\x3\x5eotball, fo\\x3\x5eosball");
let a2 = new RegExp("\\x3\\x5e", "gd");
- let a2_1 = a2.exec("table fo\\x3\x5eotball, fo\\x3\x5eosball");
+ let a2_1 = a2.exec("table fo\\x3\x5eotball, fo\\x3\x5eosball")!;
expect(a1_1[0]).toBe(a2_1[0]);
expect(a1_1[1]).toBe(a2_1[1]);
@@ -299,7 +304,9 @@ test("OnigurumaRegExp.prototype.exec() 3", () => {
expect(a1_1.input).toBe(a2_1.input);
expect(a1.lastIndex).toBe(a2.lastIndex);
expect(a1_1.groups).toBe(a2_1.groups);
+ // @ts-ignore
expect(a1_1.indices[0][0]).toBe(a2_1.indices[0][0]);
+ // @ts-ignore
expect(a1_1.indices[0][1]).toBe(a2_1.indices[0][1]);
});
@@ -320,7 +327,7 @@ test("OnigurumaRegExp.prototype.exec() 4", () => {
expect(new RegExpConstructor("\\x3\\x5\\j").source).toBe("\\x3\\x5\\j");
expect(new RegExpConstructor("\\x3\\x7\\xa").source).toBe("\\x3\\x7\\xa");
expect(new RegExpConstructor("\\j323\\x7\\xa").source).toBe(
- "\\j323\\x7\\xa"
+ "\\j323\\x7\\xa",
);
expect(new RegExpConstructor("\\x56").test("V")).toBe(true);
}
@@ -329,19 +336,19 @@ test("OnigurumaRegExp.prototype.exec() 4", () => {
test("OnigurumaRegExp.prototype.test()", () => {
expect(new RegExp("\\\\(?![*+?^${}(|)[\\]])", "g").test("\\")).toBe(true);
expect(new OnigurumaRegExp("\\\\(?![*+?^${}(|)[\\]])", "g").test("\\")).toBe(
- true
+ true,
);
expect(new RegExp("\\x56").test("V")).toBe(true);
expect(new OnigurumaRegExp("\\x56").test("V")).toBe(true);
expect(
- new RegExp("//").compile("\\\\(?![*+?^${}(|)[\\]])", "g").test("\\")
+ new RegExp("//").compile("\\\\(?![*+?^${}(|)[\\]])", "g").test("\\"),
).toBe(true);
let r = new OnigurumaRegExp("//");
expect(r.compile("\\\\(?![*+?^${}(|)[\\]])", "g").test("\\")).toBe(true);
expect(
- new OnigurumaRegExp("").compile("\\\\(?![*+?^${}(|)[\\]])", "g").test("\\")
+ new OnigurumaRegExp("").compile("\\\\(?![*+?^${}(|)[\\]])", "g").test("\\"),
).toBe(true);
});
@@ -358,11 +365,12 @@ test("OnigurumaRegExp.prototype.source", () => {
expect(new OnigurumaRegExp("/").source).toBe("\\/");
expect(new RegExp("/").source).toBe("\\/");
+ // @ts-ignore TS doesn't allow empty constructor
expect(new OnigurumaRegExp().source).toBe(new RegExp().source);
expect(new OnigurumaRegExp("").source).toBe(new RegExp("").source);
expect(new OnigurumaRegExp("a").source).toBe(new RegExp("a").source);
expect(new OnigurumaRegExp("a", "g").source).toBe(
- new RegExp("a", "g").source
+ new RegExp("a", "g").source,
);
expect(new OnigurumaRegExp("/").source).toBe(new RegExp("/").source);
expect(new OnigurumaRegExp("\n").source).toBe(new RegExp("\n").source);
@@ -370,25 +378,26 @@ test("OnigurumaRegExp.prototype.source", () => {
});
test("OnigurumaRegExp.prototype.toString()", () => {
+ // @ts-ignore
expect(new OnigurumaRegExp().toString()).toBe(new RegExp().toString());
expect(new OnigurumaRegExp("").toString()).toBe(new RegExp("").toString());
expect(new OnigurumaRegExp("a").toString()).toBe(new RegExp("a").toString());
expect(new OnigurumaRegExp("a", "g").toString()).toBe(
- new RegExp("a", "g").toString()
+ new RegExp("a", "g").toString(),
);
expect(new OnigurumaRegExp("/").toString()).toBe(new RegExp("/").toString());
expect(new OnigurumaRegExp("\n").toString()).toBe(
- new RegExp("\n").toString()
+ new RegExp("\n").toString(),
);
expect(new OnigurumaRegExp("\r").toString()).toBe(
- new RegExp("\r").toString()
+ new RegExp("\r").toString(),
);
expect(
new OnigurumaRegExp(
- "jf/.a.,voejpjoajglz;/qwjopeiv\\//\\/jpoqaj/Zdkj"
- ).toString()
+ "jf/.a.,voejpjoajglz;/qwjopeiv\\//\\/jpoqaj/Zdkj",
+ ).toString(),
).toBe(
- new RegExp("jf/.a.,voejpjoajglz;/qwjopeiv\\//\\/jpoqaj/Zdkj").toString()
+ new RegExp("jf/.a.,voejpjoajglz;/qwjopeiv\\//\\/jpoqaj/Zdkj").toString(),
);
});
@@ -429,10 +438,10 @@ test("OnigurumaRegExp flags", () => {
// case insensitive option
for (const RegExpConstructor of [OnigurumaRegExp, RegExp]) {
expect(new RegExpConstructor("Is ThIs SqL?").test("IS THIS SQL?")).toBe(
- false
+ false,
);
expect(
- new RegExpConstructor("Is ThIs SqL?", "i").test("IS THIS SQL?")
+ new RegExpConstructor("Is ThIs SqL?", "i").test("IS THIS SQL?"),
).toBe(true);
}
@@ -505,56 +514,56 @@ test("OnigurumaRegExp errors", () => {
let b = new OnigurumaRegExp("l", "m");
try {
r.compile(b, "g");
- } catch (e) {
+ } catch (e: any) {
expect(e.message).toBe(
- "Cannot supply flags when constructing one RegExp from another."
+ "Cannot supply flags when constructing one RegExp from another.",
);
}
try {
r.compile("ll", "a");
- } catch (e) {
+ } catch (e: any) {
expect(e.message).toBe("Invalid flags supplied to RegExp constructor.");
}
try {
new OnigurumaRegExp("c", "a");
- } catch (e) {
+ } catch (e: any) {
expect(e.message).toBe("Invalid flags supplied to RegExp constructor.");
}
const invalidRegExpError = "Invalid regular expression: ";
try {
new OnigurumaRegExp("?", "g");
- } catch (e) {
+ } catch (e: any) {
expect(e.message.substring(0, invalidRegExpError.length)).toBe(
- invalidRegExpError
+ invalidRegExpError,
);
}
try {
new OnigurumaRegExp("?");
- } catch (e) {
+ } catch (e: any) {
expect(e.message.substring(0, invalidRegExpError.length)).toBe(
- invalidRegExpError
+ invalidRegExpError,
);
}
try {
r.compile("?", "g");
- } catch (e) {
+ } catch (e: any) {
expect(e.message.substring(0, invalidRegExpError.length)).toBe(
- invalidRegExpError
+ invalidRegExpError,
);
}
try {
r.compile("?");
- } catch (e) {
+ } catch (e: any) {
expect(e.message.substring(0, invalidRegExpError.length)).toBe(
- invalidRegExpError
+ invalidRegExpError,
);
}
try {
new OnigurumaRegExp("\\");
- } catch (e) {
+ } catch (e: any) {
expect(e.message.substring(0, invalidRegExpError.length)).toBe(
- invalidRegExpError
+ invalidRegExpError,
);
}
});
@@ -607,7 +616,9 @@ test("OnigurumaRegExp random", () => {
expect(new OnigurumaRegExp("a", "i").sticky).toBe(false);
expect(new OnigurumaRegExp("a", "u").unicode).toBe(true);
expect(new OnigurumaRegExp("a", "d").unicode).toBe(false);
+ // @ts-ignore
expect(new RegExp("a", "d").hasIndices).toBe(true);
+ // @ts-ignore
expect(new RegExp("a", "i").hasIndices).toBe(false);
expect(new RegExp("a", "s").dotAll).toBe(true);
expect(new RegExp("a", "i").dotAll).toBe(false);
@@ -634,7 +645,7 @@ it("String.prototype.replace", () => {
expect(offset).toBe(0);
expect(string).toBe("a");
return "b";
- })
+ }),
).toBe("b");
}
@@ -652,13 +663,13 @@ it("Strings.prototype.match", () => {
let str = "The rain in SPAIN stays mainly in the plain";
for (let RegExpConstructor of [OnigurumaRegExp, RegExp]) {
let r1 = new RegExpConstructor("ain", "g");
- let m1 = str.match(r1);
+ let m1 = str.match(r1)!;
expect(m1[0]).toBe("ain");
expect(m1[1]).toBe("ain");
expect(m1[2]).toBe("ain");
r1.compile("ain", "ig");
- m1 = str.match(r1);
+ m1 = str.match(r1)!;
expect(m1[0]).toBe("ain");
expect(m1[1]).toBe("AIN");
expect(m1[2]).toBe("ain");
@@ -709,37 +720,37 @@ it("String.prototype.split", () => {
it("escapes characters, unicode, and hex", () => {
for (const RegExpConstructor of [OnigurumaRegExp, RegExp]) {
expect(new RegExpConstructor("[\\x00-\\x1F]").toString()).toBe(
- "/[\\x00-\\x1F]/"
+ "/[\\x00-\\x1F]/",
);
expect(new RegExpConstructor("[\\u0000-\\u001F]").toString()).toBe(
- "/[\\u0000-\\u001F]/"
+ "/[\\u0000-\\u001F]/",
);
var s = /\\x{7HHHHHHH}(?=\\u{1233})/;
let a = new RegExpConstructor("\u{0001F46E}");
- expect(a.exec("👮")[0]).toBe("👮");
+ expect(a.exec("👮")![0]).toBe("👮");
}
let y = new OnigurumaRegExp("[👮\\x7F](?<=👮)");
- expect(y.exec("👮\\x{7F}")[0]).toBe("👮");
+ expect(y.exec("👮\\x{7F}")![0]).toBe("👮");
let by = new OnigurumaRegExp("[👮\\cx7f](?<=👮)");
- expect(y.exec("👮\\x{7F}")[0]).toBe("👮");
+ expect(y.exec("👮\\x{7F}")![0]).toBe("👮");
let bz = new OnigurumaRegExp("[👮\\x7](?<=👮)");
let d = new OnigurumaRegExp("[\u{0001F46E}\x7F](?<=\u{0001F46E})");
- expect(d.exec("👮\x7F")[0]).toBe("👮");
+ expect(d.exec("👮\x7F")![0]).toBe("👮");
let y_2 = /[[👮\x7F](?<=👮)]/;
- expect(y_2.exec("👮]")[0]).toBe("👮]");
+ expect(y_2.exec("👮]")![0]).toBe("👮]");
let a1 = new OnigurumaRegExp("(f\xf3oo)", "gd");
let a1_1 = a1.exec("table f\xf3ootball, f\xf3oosball");
a1_1 = a1.exec("table f\xf3ootball, f\xf3oosball");
let a2 = new RegExp("(f\xf3oo)", "dg");
- let a2_1 = a2.exec("table f\xf3ootball, f\xf3oosball");
- a2_1 = a2.exec("table f\xf3ootball, f\xf3oosball");
+ let a2_1 = a2.exec("table f\xf3ootball, f\xf3oosball")!;
+ a2_1 = a2.exec("table f\xf3ootball, f\xf3oosball")!;
expect(a1_1[0]).toBe(a2_1[0]);
expect(a1_1[1]).toBe(a2_1[1]);
@@ -747,9 +758,13 @@ it("escapes characters, unicode, and hex", () => {
expect(a1_1.input).toBe(a2_1.input);
expect(a1.lastIndex).toBe(a2.lastIndex);
expect(a1_1.groups).toBe(a2_1.groups);
+ // @ts-ignore
expect(a1_1.indices[0][0]).toBe(a2_1.indices[0][0]);
+ // @ts-ignore
expect(a1_1.indices[0][1]).toBe(a2_1.indices[0][1]);
+ // @ts-ignore
expect(a1_1.indices[1][0]).toBe(a2_1.indices[1][0]);
+ // @ts-ignore
expect(a1_1.indices[1][1]).toBe(a2_1.indices[1][1]);
});
@@ -768,20 +783,20 @@ it("lookbehinds", () => {
expect(
/[\x00-\x1F\x27\x5C\x7F-\x9F]|[\uD800-\uDBFF]\(?<=[\uDC00-\uDFFF]\)|(?!.*[\uD800-\uDBFF][\uDC00-\uDFFF]).*[\uDC00-\uDFFF]/ instanceof
- RegExp
+ RegExp,
).toBe(true);
expect(
/[\x00-\x1F\x27\x5C\x7F-\x9F]|[\uD800-\uDBFF](?<=[\uDC00-\uDFFF])|(?!.*[\uD800-\uDBFF][\uDC00-\uDFFF]).*[\uDC00-\uDFFF]/ instanceof
- OnigurumaRegExp
+ OnigurumaRegExp,
).toBe(true);
expect(/(?<=\1d(o))/ instanceof OnigurumaRegExp).toBe(true);
expect(/\(?<=\1d(o)\)/ instanceof OnigurumaRegExp).toBe(false);
expect(
- /(?!.*[\uD800-\uDBFF][\uDC00-\uDFFF]).*[\uDC00-\uDFFF]/ instanceof RegExp
+ /(?!.*[\uD800-\uDBFF][\uDC00-\uDFFF]).*[\uDC00-\uDFFF]/ instanceof RegExp,
).toBe(true);
expect(
- /\(?!.*[\uD800-\uDBFF][\uDC00-\uDFFF]\).*[\uDC00-\uDFFF]/ instanceof RegExp
+ /\(?!.*[\uD800-\uDBFF][\uDC00-\uDFFF]\).*[\uDC00-\uDFFF]/ instanceof RegExp,
).toBe(true);
let e = new OnigurumaRegExp("(?<=)");
diff --git a/test/bun.js/os.test.js b/test/bun.js/os.test.js
index c368298cb..792d2cf40 100644
--- a/test/bun.js/os.test.js
+++ b/test/bun.js/os.test.js
@@ -41,11 +41,11 @@ it("tmpdir", () => {
if (process.platform === "win32") {
expect(os.tmpdir()).toBe(process.env.TEMP || process.env.TMP);
expect(os.tmpdir()).toBe(
- `${process.env.SystemRoot || process.env.windir}\\temp`
+ `${process.env.SystemRoot || process.env.windir}\\temp`,
);
} else {
expect(os.tmpdir()).toBe(
- process.env.TMPDIR || process.env.TMP || process.env.TEMP || "/tmp"
+ process.env.TMPDIR || process.env.TMP || process.env.TEMP || "/tmp",
);
}
});
@@ -57,8 +57,8 @@ it("hostname", () => {
it("platform", () => {
expect(
["win32", "darwin", "linux", "wasm"].some(
- (platform) => os.platform() === platform
- )
+ (platform) => os.platform() === platform,
+ ),
).toBe(true);
});
@@ -68,7 +68,7 @@ it("release", () => {
it("type", () => {
expect(
- ["Windows_NT", "Darwin", "Linux"].some((type) => os.type() === type)
+ ["Windows_NT", "Darwin", "Linux"].some((type) => os.type() === type),
).toBe(true);
});
diff --git a/test/bun.js/path.test.js b/test/bun.js/path.test.js
index 72dad93d2..97132512c 100644
--- a/test/bun.js/path.test.js
+++ b/test/bun.js/path.test.js
@@ -66,7 +66,7 @@ it("path.basename", () => {
// On unix a backslash is just treated as any other character.
strictEqual(
path.posix.basename("\\dir\\basename.ext"),
- "\\dir\\basename.ext"
+ "\\dir\\basename.ext",
);
strictEqual(path.posix.basename("\\basename.ext"), "\\basename.ext");
strictEqual(path.posix.basename("basename.ext"), "basename.ext");
@@ -79,7 +79,7 @@ it("path.basename", () => {
const controlCharFilename = `Icon${String.fromCharCode(13)}`;
strictEqual(
path.posix.basename(`/a/b/${controlCharFilename}`),
- controlCharFilename
+ controlCharFilename,
);
});
@@ -215,7 +215,7 @@ it("path.join", () => {
if (actual !== expected && actualAlt !== expected) {
const delimiter = test[0].map(JSON.stringify).join(",");
const message = `path.${os}.join(${delimiter})\n expect=${JSON.stringify(
- expected
+ expected,
)}\n actual=${JSON.stringify(actual)}`;
failures.push(`\n${message}`);
}
@@ -295,7 +295,7 @@ it("path.relative", () => {
.slice(0, 2)
.map(JSON.stringify)
.join(",")})\n expect=${JSON.stringify(
- expected
+ expected,
)}\n actual=${JSON.stringify(actual)}`;
failures.push(`\n${message}`);
}
@@ -355,7 +355,7 @@ it("path.normalize", () => {
strictEqual(
path.posix.normalize("./fixtures///b/../b/c.js"),
- "fixtures/b/c.js"
+ "fixtures/b/c.js",
);
strictEqual(path.posix.normalize("/foo/../../../bar"), "/bar");
strictEqual(path.posix.normalize("a//b//../b"), "a/b");
@@ -372,19 +372,19 @@ it("path.normalize", () => {
strictEqual(path.posix.normalize("../.../.././.../../../bar"), "../../bar");
strictEqual(
path.posix.normalize("../../../foo/../../../bar"),
- "../../../../../bar"
+ "../../../../../bar",
);
strictEqual(
path.posix.normalize("../../../foo/../../../bar/../../"),
- "../../../../../../"
+ "../../../../../../",
);
strictEqual(
path.posix.normalize("../foobar/barfoo/foo/../../../bar/../../"),
- "../../"
+ "../../",
);
strictEqual(
path.posix.normalize("../.../../foobar/../../../bar/../../baz"),
- "../../../../baz"
+ "../../../../baz",
);
strictEqual(path.posix.normalize("foo/bar\\baz"), "foo/bar\\baz");
});
@@ -446,7 +446,7 @@ it("path.resolve", () => {
const message = `path.${os}.resolve(${test
.map(JSON.stringify)
.join(",")})\n expect=${JSON.stringify(
- expected
+ expected,
)}\n actual=${JSON.stringify(actual)}`;
if (actual !== expected && actualAlt !== expected) failures.push(message);
});
diff --git a/test/bun.js/peek.test.ts b/test/bun.js/peek.test.ts
index 90a7748f5..1c3920a4b 100644
--- a/test/bun.js/peek.test.ts
+++ b/test/bun.js/peek.test.ts
@@ -22,11 +22,14 @@ test("peek", () => {
// If we peek a rejected promise, it:
// - returns the error
// - does not mark the promise as handled
- const rejected = Promise.reject(
- new Error("Succesfully tested promise rejection")
+ const rejected = Promise.reject<Error>(
+ new Error("Succesfully tested promise rejection"),
+ );
+ const peeked = peek(rejected);
+ expect(peeked instanceof Error).toBe(true);
+ expect((peeked as Error).message).toBe(
+ "Succesfully tested promise rejection",
);
- expect(peek(rejected).message).toBe("Succesfully tested promise rejection");
- rejected.catch(() => {});
});
test("peek.status", () => {
diff --git a/test/bun.js/performance.test.js b/test/bun.js/performance.test.js
index 0ff75b945..51479209c 100644
--- a/test/bun.js/performance.test.js
+++ b/test/bun.js/performance.test.js
@@ -19,6 +19,6 @@ it("performance.now() should be monotonic", () => {
it("performance.timeOrigin + performance.now() should be similar to Date.now()", () => {
expect(
- Math.abs(performance.timeOrigin + performance.now() - Date.now()) < 1000
+ Math.abs(performance.timeOrigin + performance.now() - Date.now()) < 1000,
).toBe(true);
});
diff --git a/test/bun.js/plugins.d.ts b/test/bun.js/plugins.d.ts
new file mode 100644
index 000000000..aebfd952b
--- /dev/null
+++ b/test/bun.js/plugins.d.ts
@@ -0,0 +1,11 @@
+declare var objectModuleResult: any;
+declare var laterCode: any;
+
+declare module "beep:*";
+declare module "async:*";
+declare module "asyncret:*";
+declare module "asyncfail:*";
+declare module "async-obj:*";
+declare module "obj:*";
+declare module "delay:*";
+declare module "./*.svelte";
diff --git a/test/bun.js/plugins.test.ts b/test/bun.js/plugins.test.ts
index 6593b077d..1d0b0821a 100644
--- a/test/bun.js/plugins.test.ts
+++ b/test/bun.js/plugins.test.ts
@@ -1,3 +1,4 @@
+/// <reference types="./plugins" />
import { plugin } from "bun";
import { describe, expect, it } from "bun:test";
import { resolve } from "path";
@@ -45,7 +46,7 @@ plugin({
}));
builder.onLoad(
{ filter: /.*/, namespace: "fail" },
- () => globalThis.failingObject
+ () => globalThis.failingObject,
);
},
});
@@ -106,7 +107,7 @@ plugin({
});
}, 1);
});
- }
+ },
);
builder.onResolve({ filter: /.*/, namespace: "asyncfail" }, ({ path }) => ({
@@ -121,7 +122,7 @@ plugin({
await Promise.resolve(1);
await 1;
throw globalThis.asyncfail;
- }
+ },
);
builder.onResolve({ filter: /.*/, namespace: "asyncret" }, ({ path }) => ({
@@ -136,7 +137,7 @@ plugin({
await 100;
await Promise.resolve(10);
return await globalThis.asyncret;
- }
+ },
);
},
});
@@ -170,7 +171,8 @@ describe("require", () => {
describe("dynamic import", () => {
it("SSRs `<h1>Hello world!</h1>` with Svelte", async () => {
- const { default: App } = await import("./hello.svelte");
+ const { default: App }: any = await import("./hello.svelte");
+
const { html } = App.render();
expect(html).toBe("<h1>Hello world!</h1>");
@@ -240,7 +242,7 @@ describe("errors", () => {
try {
require(`fail:my-file-${loader}`);
throw -1;
- } catch (e) {
+ } catch (e: any) {
if (e === -1) {
throw new Error("Expected error");
}
@@ -259,7 +261,7 @@ describe("errors", () => {
try {
require(`fail:my-file-${loader}-3`);
throw -1;
- } catch (e) {
+ } catch (e: any) {
if (e === -1) {
throw new Error("Expected error");
}
@@ -273,7 +275,7 @@ describe("errors", () => {
globalThis.asyncret = { wat: true };
await import("asyncret:my-file");
throw -1;
- } catch (e) {
+ } catch (e: any) {
if (e === -1) {
throw new Error("Expected error");
}
@@ -287,7 +289,7 @@ describe("errors", () => {
globalThis.asyncfail = new Error("async error");
await import("asyncfail:my-file");
throw -1;
- } catch (e) {
+ } catch (e: any) {
if (e === -1) {
throw new Error("Expected error");
}
@@ -307,7 +309,7 @@ describe("errors", () => {
try {
require(`fail:my-file-${i}-2`);
throw -1;
- } catch (e) {
+ } catch (e: any) {
if (e === -1) {
throw new Error("Expected error");
}
@@ -321,7 +323,7 @@ describe("errors", () => {
globalThis.asyncOnLoad = `const x: string = -NaNAn../!!;`;
await import("async:fail");
throw -1;
- } catch (e) {
+ } catch (e: any) {
if (e === -1) {
throw new Error("Expected error");
}
diff --git a/test/bun.js/print-process-args.js b/test/bun.js/print-process-args.js
index 3d4540053..0ab238122 100644
--- a/test/bun.js/print-process-args.js
+++ b/test/bun.js/print-process-args.js
@@ -1,4 +1,4 @@
-var writer = Bun.stdout.writer()
+var writer = Bun.stdout.writer();
writer.write(JSON.stringify(process.argv));
await writer.flush(true);
-process.exit(0); \ No newline at end of file
+process.exit(0);
diff --git a/test/bun.js/process-args.test.js b/test/bun.js/process-args.test.js
index 6bdfbf9e0..512b6b92c 100644
--- a/test/bun.js/process-args.test.js
+++ b/test/bun.js/process-args.test.js
@@ -1,33 +1,41 @@
-
import { spawn } from "bun";
import { test, expect } from "bun:test";
test("args exclude run", async () => {
- const arg0 = process.argv[0];
- const arg1 = import.meta.dir + '/print-process-args.js';
+ const arg0 = process.argv[0];
+ const arg1 = import.meta.dir + "/print-process-args.js";
- const exe = process.versions.bun.includes("debug") ? "bun-debug" : "bun";
+ const exe = process.versions.bun.includes("debug") ? "bun-debug" : "bun";
- const { stdout: s1 } = spawn([exe, "print-process-args.js"], { cwd: import.meta.dir });
- const t1 = JSON.parse(await new Response(s1).text());
- expect(t1[0]).toBe(arg0);
- expect(t1[1]).toBe(arg1);
+ const { stdout: s1 } = spawn([exe, "print-process-args.js"], {
+ cwd: import.meta.dir,
+ });
+ const t1 = JSON.parse(await new Response(s1).text());
+ expect(t1[0]).toBe(arg0);
+ expect(t1[1]).toBe(arg1);
- const { stdout: s2 } = spawn([exe, "print-process-args.js", "arg1"], { cwd: import.meta.dir });
- const t2 = JSON.parse(await new Response(s2).text());
- expect(t2[0]).toBe(arg0);
- expect(t2[1]).toBe(arg1);
- expect(t2[2]).toBe("arg1");
+ const { stdout: s2 } = spawn([exe, "print-process-args.js", "arg1"], {
+ cwd: import.meta.dir,
+ });
+ const t2 = JSON.parse(await new Response(s2).text());
+ expect(t2[0]).toBe(arg0);
+ expect(t2[1]).toBe(arg1);
+ expect(t2[2]).toBe("arg1");
- const { stdout: s3 } = spawn([exe, "run", "print-process-args.js"], { cwd: import.meta.dir });
- const t3 = JSON.parse(await new Response(s3).text());
- expect(t3[0]).toBe(arg0);
- expect(t3[1]).toBe(arg1);
+ const { stdout: s3 } = spawn([exe, "run", "print-process-args.js"], {
+ cwd: import.meta.dir,
+ });
+ const t3 = JSON.parse(await new Response(s3).text());
+ expect(t3[0]).toBe(arg0);
+ expect(t3[1]).toBe(arg1);
- const { stdout: s4 } = spawn([exe, "run", "print-process-args.js", "arg1", "arg2"], { cwd: import.meta.dir });
- const t4 = JSON.parse(await new Response(s4).text());
- expect(t4[0]).toBe(arg0);
- expect(t4[1]).toBe(arg1);
- expect(t4[2]).toBe("arg1");
- expect(t4[3]).toBe("arg2");
-}); \ No newline at end of file
+ const { stdout: s4 } = spawn(
+ [exe, "run", "print-process-args.js", "arg1", "arg2"],
+ { cwd: import.meta.dir },
+ );
+ const t4 = JSON.parse(await new Response(s4).text());
+ expect(t4[0]).toBe(arg0);
+ expect(t4[1]).toBe(arg1);
+ expect(t4[2]).toBe("arg1");
+ expect(t4[3]).toBe("arg2");
+});
diff --git a/test/bun.js/process-nexttick.js b/test/bun.js/process-nexttick.js
index 337977c0a..ea9d0581e 100644
--- a/test/bun.js/process-nexttick.js
+++ b/test/bun.js/process-nexttick.js
@@ -59,7 +59,7 @@ await new Promise((resolve, reject) => {
if (!passed)
throw new Error(
- "queueMicrotask should throw a TypeError if the argument is not a function"
+ "queueMicrotask should throw a TypeError if the argument is not a function",
);
}
@@ -73,7 +73,7 @@ await new Promise((resolve, reject) => {
if (!passed)
throw new Error(
- "queueMicrotask should throw a TypeError if the argument is empty"
+ "queueMicrotask should throw a TypeError if the argument is empty",
);
}
@@ -86,6 +86,6 @@ await new Promise((resolve, reject) => {
resolve(true);
},
12345,
- "hello"
+ "hello",
);
});
diff --git a/test/bun.js/process-nexttick.test.js b/test/bun.js/process-nexttick.test.js
index f6d2b7663..a1b1b84b0 100644
--- a/test/bun.js/process-nexttick.test.js
+++ b/test/bun.js/process-nexttick.test.js
@@ -61,7 +61,7 @@ it("process.nextTick", async () => {
if (!passed)
throw new Error(
- "queueMicrotask should throw a TypeError if the argument is not a function"
+ "queueMicrotask should throw a TypeError if the argument is not a function",
);
}
@@ -75,7 +75,7 @@ it("process.nextTick", async () => {
if (!passed)
throw new Error(
- "queueMicrotask should throw a TypeError if the argument is empty"
+ "queueMicrotask should throw a TypeError if the argument is empty",
);
}
});
@@ -89,7 +89,7 @@ it("process.nextTick 2 args", async () => {
resolve(true);
},
12345,
- "hello"
+ "hello",
);
});
});
diff --git a/test/bun.js/process.test.js b/test/bun.js/process.test.js
index 3ca93c983..296e786cf 100644
--- a/test/bun.js/process.test.js
+++ b/test/bun.js/process.test.js
@@ -40,7 +40,7 @@ it("process", () => {
if (typeof JSON.parse(JSON.stringify(process.env)).toJSON !== "undefined") {
throw new Error(
- "process.env should call toJSON to hide its internal state"
+ "process.env should call toJSON to hide its internal state",
);
}
@@ -72,6 +72,6 @@ it("process.release", () => {
expect(process.release.sourceUrl).toBe(
`https://github.com/oven-sh/bun/release/bun-v${process.versions.bun}/bun-${
process.platform
- }-${{ arm64: "aarch64", x64: "x64" }[process.arch] || process.arch}.zip`
+ }-${{ arm64: "aarch64", x64: "x64" }[process.arch] || process.arch}.zip`,
);
});
diff --git a/test/bun.js/react-dom-server.bun.cjs b/test/bun.js/react-dom-server.bun.cjs
index 9cc42cc6a..6367ee8aa 100644
--- a/test/bun.js/react-dom-server.bun.cjs
+++ b/test/bun.js/react-dom-server.bun.cjs
@@ -1,5 +1,5 @@
/**
-* @license React
+ * @license React
* react-dom-server.bun.production.min.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -8,131 +8,2995 @@
* LICENSE file in the root directory of this source tree.
*/
-'use strict';var ba=require("react"),ca=require("react-dom");function l(a,b){0!==b.length&&a.write(b)}function da(a,b){"function"===typeof a.error?a.error(b):a.close()}
-var r=Object.prototype.hasOwnProperty,ea=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,fa={},ha={};
-function ia(a){if(r.call(ha,a))return!0;if(r.call(fa,a))return!1;if(ea.test(a))return ha[a]=!0;fa[a]=!0;return!1}function t(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var v={},ja="children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ");
-ja.push("innerText","textContent");ja.forEach(function(a){v[a]=new t(a,0,!1,a,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var b=a[0];v[b]=new t(b,1,!1,a[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(a){v[a]=new t(a,2,!1,a.toLowerCase(),null,!1,!1)});
-["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){v[a]=new t(a,2,!1,a,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){v[a]=new t(a,3,!1,a.toLowerCase(),null,!1,!1)});
-["checked","multiple","muted","selected"].forEach(function(a){v[a]=new t(a,3,!0,a,null,!1,!1)});["capture","download"].forEach(function(a){v[a]=new t(a,4,!1,a,null,!1,!1)});["cols","rows","size","span"].forEach(function(a){v[a]=new t(a,6,!1,a,null,!1,!1)});["rowSpan","start"].forEach(function(a){v[a]=new t(a,5,!1,a.toLowerCase(),null,!1,!1)});var ka=/[\-:]([a-z])/g;function la(a){return a[1].toUpperCase()}
-"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var b=a.replace(ka,
-la);v[b]=new t(b,1,!1,a,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var b=a.replace(ka,la);v[b]=new t(b,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(a){var b=a.replace(ka,la);v[b]=new t(b,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(a){v[a]=new t(a,1,!1,a.toLowerCase(),null,!1,!1)});
-v.xlinkHref=new t("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(a){v[a]=new t(a,1,!1,a.toLowerCase(),null,!0,!0)});
-var ma={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,
-zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},na=["Webkit","ms","Moz","O"];Object.keys(ma).forEach(function(a){na.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);ma[b]=ma[a]})});var oa=/["'&<>]/;
-function w(a){if("boolean"===typeof a||"number"===typeof a)return""+a;a=""+a;var b=oa.exec(a);if(b){var c="",d,e=0;for(d=b.index;d<a.length;d++){switch(a.charCodeAt(d)){case 34:b="&quot;";break;case 38:b="&amp;";break;case 39:b="&#x27;";break;case 60:b="&lt;";break;case 62:b="&gt;";break;default:continue}e!==d&&(c+=a.substring(e,d));e=d+1;c+=b}a=e!==d?c+a.substring(e,d):c}return a}var pa=/([A-Z])/g,qa=/^ms-/,ra=Array.isArray,x=Object.assign,y=null,sa=[],va={preload:ta,preinit:ua};
-function ta(a,b){if(y){var c=y;if("string"===typeof a&&a&&"object"===typeof b&&null!==b){var d=b.as,e=c.preloadsMap.get(a);e||(e=z(c,a,d,{href:a,rel:"preload",as:d,crossOrigin:"font"===d?"":b.crossOrigin,integrity:b.integrity}));switch(d){case "font":c.fontPreloads.add(e);break;case "style":c.explicitStylePreloads.add(e);break;case "script":c.explicitScriptPreloads.add(e)}}}}
-function ua(a,b){if(y){var c=y;if("string"===typeof a&&a&&"object"===typeof b&&null!==b)switch(b.as){case "style":var d=c.stylesMap.get(a);d||(d=b.precedence||"default",d=wa(c,a,d,{rel:"stylesheet",href:a,"data-precedence":d,crossOrigin:b.crossOrigin}));d.set.add(d);c.explicitStylePreloads.add(d.hint);break;case "script":d=c.scriptsMap.get(a),d||(d=xa(c,a,{src:a,async:!0,crossOrigin:b.crossOrigin,integrity:b.integrity}),c.scripts.add(d))}}}
-function ya(a,b){return{rel:"preload",as:"style",href:a,crossOrigin:b.crossOrigin,integrity:b.integrity,media:b.media,hrefLang:b.hrefLang,referrerPolicy:b.referrerPolicy}}function za(a,b){return{rel:"preload",as:"script",href:a,crossOrigin:b.crossOrigin,integrity:b.integrity,referrerPolicy:b.referrerPolicy}}function z(a,b,c,d){c={type:"preload",as:c,href:b,flushed:!1,props:d};a.preloadsMap.set(b,c);return c}
-function wa(a,b,c,d){var e=a.stylesMap,f=a.preloadsMap,g=a.precedences,h=g.get(c);h||(h=new Set,g.set(c,h));(f=f.get(b))?(a=f.props,null==d.crossOrigin&&(d.crossOrigin=a.crossOrigin),null==d.referrerPolicy&&(d.referrerPolicy=a.referrerPolicy),null==d.title&&(d.title=a.title)):(f=ya(b,d),f=z(a,b,"style",f),a.explicitStylePreloads.add(f));c={type:"style",href:b,precedence:c,flushed:!1,inShell:!1,props:d,hint:f,set:h};e.set(b,c);return c}
-function xa(a,b,c){var d=a.scriptsMap,e=a.preloadsMap.get(b);e?(a=e.props,null==c.crossOrigin&&(c.crossOrigin=a.crossOrigin),null==c.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),null==c.integrity&&(c.integrity=a.integrity)):(e=za(b,c),e=z(a,b,"script",e),a.explicitScriptPreloads.add(e));c={type:"script",src:b,flushed:!1,props:c,hint:e};d.set(b,c);return c}
-function Aa(a,b){if(!y)throw Error('"currentResources" was expected to exist. This is a bug in React.');var c=y;switch(a){case "title":var d=b.children;Array.isArray(d)&&1===d.length&&(d=d[0]);if("string"===typeof d||"number"===typeof d){var e="title::"+d;a=c.headsMap.get(e);a||(b=x({},b),b.children=d,a={type:"title",props:b,flushed:!1},c.headsMap.set(e,a),c.headResources.add(a))}return!0;case "meta":if("string"===typeof b.charSet)e="charSet";else if("string"===typeof b.content)if(a="::"+b.content,
-"string"===typeof b.httpEquiv)e="httpEquiv::"+b.httpEquiv+a;else if("string"===typeof b.name)e="name::"+b.name+a;else if("string"===typeof b.itemProp)e="itemProp::"+b.itemProp+a;else if("string"===typeof b.property){var f=b.property;e="property::"+f+a;d=f;a=f.split(":").slice(0,-1).join(":");(a=c.structuredMetaKeys.get(a))&&(e=a.key+"::child::"+e)}e&&!c.headsMap.has(e)&&(b={type:"meta",key:e,props:x({},b),flushed:!1},c.headsMap.set(e,b),"charSet"===e?c.charset=b:(d&&c.structuredMetaKeys.set(d,b),
-c.headResources.add(b)));return!0;case "base":return e=b.target,d=b.href,e="base"+("string"===typeof d?'[href="'+d+'"]':":not([href])")+("string"===typeof e?'[target="'+e+'"]':":not([target])"),c.headsMap.has(e)||(b={type:"base",props:x({},b),flushed:!1},c.headsMap.set(e,b),c.bases.add(b)),!0}return!1}
-function Ba(a){if(!y)throw Error('"currentResources" was expected to exist. This is a bug in React.');var b=y,c=a.rel,d=a.href;if(!d||"string"!==typeof d||!c||"string"!==typeof c)return!1;switch(c){case "stylesheet":var e=a.onLoad,f=a.onError;c=a.precedence;var g=a.disabled;if("string"!==typeof c||e||f||null!=g)return c=b.preloadsMap.get(d),c||(c=z(b,d,"style",ya(d,a)),b.usedStylePreloads.add(c)),!1;e=b.stylesMap.get(d);e||(a=x({},a),a.href=d,a.rel="stylesheet",a["data-precedence"]=c,delete a.precedence,
-e=wa(y,d,c,a),b.usedStylePreloads.add(e.hint));b.boundaryResources?b.boundaryResources.add(e):e.set.add(e);return!0;case "preload":switch(e=a.as,e){case "script":case "style":case "font":c=b.preloadsMap.get(d);if(!c)switch(a=x({},a),a.href=d,a.rel="preload",a.as=e,"font"===e&&(a.crossOrigin=""),c=z(b,d,e,a),e){case "script":b.explicitScriptPreloads.add(c);break;case "style":b.explicitStylePreloads.add(c);break;case "font":b.fontPreloads.add(c)}return!0}}if(a.onLoad||a.onError)return!0;d="rel:"+c+
-"::href:"+d+"::sizes:"+("string"===typeof a.sizes?a.sizes:"")+"::media:"+("string"===typeof a.media?a.media:"");e=b.headsMap.get(d);if(!e)switch(e={type:"link",props:x({},a),flushed:!1},b.headsMap.set(d,e),c){case "preconnect":case "dns-prefetch":b.preconnects.add(e);break;default:b.headResources.add(e)}return!0}function Ca(a,b){var c=a.boundaryResources;c&&(b.forEach(function(a){return c.add(a)}),b.clear())}function Da(a,b){b.forEach(function(a){return a.set.add(a)});b.clear()}
-var Ea=ca.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,Fa=/(<\/|<)(s)(cript)/gi;function Ga(a,b,c,d){return""+b+("s"===c?"\\u0073":"\\u0053")+d}
-function Ha(a,b,c,d,e){a=void 0===a?"":a;b=void 0===b?"<script>":'<script nonce="'+w(b)+'">';var f=[];void 0!==c&&f.push(b,(""+c).replace(Fa,Ga),"\x3c/script>");if(void 0!==d)for(c=0;c<d.length;c++){var g=d[c],h="string"===typeof g?void 0:g.integrity;f.push('<script src="',w("string"===typeof g?g:g.src));h&&f.push('" integrity="',w(h));f.push('" async="">\x3c/script>')}if(void 0!==e)for(d=0;d<e.length;d++)c=e[d],g="string"===typeof c?void 0:c.integrity,f.push('<script type="module" src="',w("string"===
-typeof c?c:c.src)),g&&f.push('" integrity="',w(g)),f.push('" async="">\x3c/script>');return{bootstrapChunks:f,startInlineScript:b,placeholderPrefix:a+"P:",segmentPrefix:a+"S:",boundaryPrefix:a+"B:",idPrefix:a,nextSuspenseID:0,sentCompleteSegmentFunction:!1,sentCompleteBoundaryFunction:!1,sentClientRenderFunction:!1,sentStyleInsertionFunction:!1}}function A(a,b,c){return{insertionMode:a,selectedValue:b,noscriptTagInScope:c}}
-function Ia(a){return A("http://www.w3.org/2000/svg"===a?2:"http://www.w3.org/1998/Math/MathML"===a?3:0,null,!1)}
-function Ja(a,b,c){switch(b){case "noscript":return A(1,null,!0);case "select":return A(1,null!=c.value?c.value:c.defaultValue,a.noscriptTagInScope);case "svg":return A(2,null,a.noscriptTagInScope);case "math":return A(3,null,a.noscriptTagInScope);case "foreignObject":return A(1,null,a.noscriptTagInScope);case "table":return A(4,null,a.noscriptTagInScope);case "thead":case "tbody":case "tfoot":return A(5,null,a.noscriptTagInScope);case "colgroup":return A(7,null,a.noscriptTagInScope);case "tr":return A(6,
-null,a.noscriptTagInScope)}return 4<=a.insertionMode||0===a.insertionMode?A(1,null,a.noscriptTagInScope):a}function Ka(a,b,c,d){if(""===b)return d;d&&a.push("\x3c!-- --\x3e");a.push(w(b));return!0}var La=new Map;
-function Ma(a,b,c){if("object"!==typeof c)throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");b=!0;for(var d in c)if(r.call(c,d)){var e=c[d];if(null!=e&&"boolean"!==typeof e&&""!==e){if(0===d.indexOf("--")){var f=w(d);e=w((""+e).trim())}else{f=d;var g=La.get(f);void 0!==g?f=g:(g=w(f.replace(pa,"-$1").toLowerCase().replace(qa,"-ms-")),La.set(f,g),f=g);e="number"===typeof e?0===e||r.call(ma,
-d)?""+e:e+"px":w((""+e).trim())}b?(b=!1,a.push(' style="',f,":",e)):a.push(";",f,":",e)}}b||a.push('"')}
-function C(a,b,c,d){switch(c){case "style":Ma(a,b,d);return;case "defaultValue":case "defaultChecked":case "innerHTML":case "suppressContentEditableWarning":case "suppressHydrationWarning":return}if(!(2<c.length)||"o"!==c[0]&&"O"!==c[0]||"n"!==c[1]&&"N"!==c[1])if(b=v.hasOwnProperty(c)?v[c]:null,null!==b){switch(typeof d){case "function":case "symbol":return;case "boolean":if(!b.acceptsBooleans)return}c=b.attributeName;switch(b.type){case 3:d&&a.push(" ",c,'=""');break;case 4:!0===d?a.push(" ",c,'=""'):
-!1!==d&&a.push(" ",c,'="',w(d),'"');break;case 5:isNaN(d)||a.push(" ",c,'="',w(d),'"');break;case 6:!isNaN(d)&&1<=d&&a.push(" ",c,'="',w(d),'"');break;default:b.sanitizeURL&&(d=""+d),a.push(" ",c,'="',w(d),'"')}}else if(ia(c)){switch(typeof d){case "function":case "symbol":return;case "boolean":if(b=c.toLowerCase().slice(0,5),"data-"!==b&&"aria-"!==b)return}a.push(" ",c,'="',w(d),'"')}}
-function D(a,b,c){if(null!=b){if(null!=c)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if("object"!==typeof b||!("__html"in b))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");b=b.__html;null!==b&&void 0!==b&&a.push(""+b)}}function Na(a){var b="";ba.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}
-function F(a,b,c){var d="stylesheet"===b.rel;a.push(G("link"));for(var e in b)if(r.call(b,e)){var f=b[e];if(null!=f)switch(e){case "children":case "dangerouslySetInnerHTML":throw Error("link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");case "precedence":if(d)continue;default:C(a,c,e,f)}}a.push("/>");return null}
-function I(a,b,c,d){a.push(G(c));for(var e in b)if(r.call(b,e)){var f=b[e];if(null!=f)switch(e){case "children":case "dangerouslySetInnerHTML":throw Error(c+" is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:C(a,d,e,f)}}a.push("/>");return null}
-function Oa(a,b,c){a.push(G("title"));var d=null,e;for(e in b)if(r.call(b,e)){var f=b[e];if(null!=f)switch(e){case "children":d=f;break;case "dangerouslySetInnerHTML":throw Error("`dangerouslySetInnerHTML` does not make sense on <title>.");default:C(a,c,e,f)}}a.push(">");b=Array.isArray(d)&&2>d.length?d[0]||null:d;"string"!==typeof b&&"number"!==typeof b||a.push(w(b));a.push("</","title",">");return null}
-function Pa(a,b,c){a.push(G("script"));var d=null,e=null,f;for(f in b)if(r.call(b,f)){var g=b[f];if(null!=g)switch(f){case "children":d=g;break;case "dangerouslySetInnerHTML":e=g;break;default:C(a,c,f,g)}}a.push(">");D(a,e,d);"string"===typeof d&&a.push(w(d));a.push("</","script",">");return null}
-function J(a,b,c,d){a.push(G(c));var e=c=null,f;for(f in b)if(r.call(b,f)){var g=b[f];if(null!=g)switch(f){case "children":c=g;break;case "dangerouslySetInnerHTML":e=g;break;default:C(a,d,f,g)}}a.push(">");D(a,e,c);return"string"===typeof c?(a.push(w(c)),null):c}var Qa=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Ra=new Map;function G(a){var b=Ra.get(a);if(void 0===b){if(!Qa.test(a))throw Error("Invalid tag: "+a);b="<"+a;Ra.set(a,b)}return b}
-function Sa(a,b,c,d,e,f,g){switch(c){case "select":a.push(G("select"));var h=g=null,m;for(m in d)if(r.call(d,m)){var k=d[m];if(null!=k)switch(m){case "children":g=k;break;case "dangerouslySetInnerHTML":h=k;break;case "defaultValue":case "value":break;default:C(a,e,m,k)}}a.push(">");D(a,h,g);return g;case "option":g=f.selectedValue;a.push(G("option"));var p=m=k=null,n=null;for(h in d)if(r.call(d,h)){var q=d[h];if(null!=q)switch(h){case "children":k=q;break;case "selected":p=q;break;case "dangerouslySetInnerHTML":n=
-q;break;case "value":m=q;default:C(a,e,h,q)}}if(null!=g)if(d=null!==m?""+m:Na(k),ra(g))for(e=0;e<g.length;e++){if(""+g[e]===d){a.push(' selected=""');break}}else""+g===d&&a.push(' selected=""');else p&&a.push(' selected=""');a.push(">");D(a,n,k);return k;case "textarea":a.push(G("textarea"));k=h=g=null;for(n in d)if(r.call(d,n)&&(m=d[n],null!=m))switch(n){case "children":k=m;break;case "value":g=m;break;case "defaultValue":h=m;break;case "dangerouslySetInnerHTML":throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");
-default:C(a,e,n,m)}null===g&&null!==h&&(g=h);a.push(">");if(null!=k){if(null!=g)throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(ra(k)&&1<k.length)throw Error("<textarea> can only have at most one child.");g=""+k}"string"===typeof g&&"\n"===g[0]&&a.push("\n");null!==g&&a.push(w(""+g));return null;case "input":a.push(G("input"));m=n=h=g=null;for(k in d)if(r.call(d,k)&&(p=d[k],null!=p))switch(k){case "children":case "dangerouslySetInnerHTML":throw Error("input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
-case "defaultChecked":m=p;break;case "defaultValue":h=p;break;case "checked":n=p;break;case "value":g=p;break;default:C(a,e,k,p)}null!==n?C(a,e,"checked",n):null!==m&&C(a,e,"checked",m);null!==g?C(a,e,"value",g):null!==h&&C(a,e,"value",h);a.push("/>");return null;case "menuitem":a.push(G("menuitem"));for(var u in d)if(r.call(d,u)&&(g=d[u],null!=g))switch(u){case "children":case "dangerouslySetInnerHTML":throw Error("menuitems cannot have `children` nor `dangerouslySetInnerHTML`.");default:C(a,e,u,
-g)}a.push(">");return null;case "title":return a=2!==f.insertionMode&&!f.noscriptTagInScope&&Aa("title",d)?null:Oa(a,d,e),a;case "link":return!f.noscriptTagInScope&&Ba(d)?(g&&a.push("\x3c!-- --\x3e"),a=null):a=F(a,d,e),a;case "script":if(h=!f.noscriptTagInScope){if(!y)throw Error('"currentResources" was expected to exist. This is a bug in React.');h=y;k=d.src;n=d.onLoad;m=d.onError;k&&"string"===typeof k?d.async?(n||m?(n=h.preloadsMap.get(k),n||(n=z(h,k,"script",za(k,d)),h.usedScriptPreloads.add(n))):
-(n=h.scriptsMap.get(k),n||(n=x({},d),n.src=k,n=xa(h,k,n),h.scripts.add(n))),h=!0):h=!1:h=!1}h?(g&&a.push("\x3c!-- --\x3e"),a=null):a=Pa(a,d,e);return a;case "meta":return!f.noscriptTagInScope&&Aa("meta",d)?(g&&a.push("\x3c!-- --\x3e"),a=null):a=I(a,d,"meta",e),a;case "base":return!f.noscriptTagInScope&&Aa("base",d)?(g&&a.push("\x3c!-- --\x3e"),a=null):a=I(a,d,"base",e),a;case "listing":case "pre":a.push(G(c));h=g=null;for(p in d)if(r.call(d,p)&&(k=d[p],null!=k))switch(p){case "children":g=k;break;
-case "dangerouslySetInnerHTML":h=k;break;default:C(a,e,p,k)}a.push(">");if(null!=h){if(null!=g)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");if("object"!==typeof h||!("__html"in h))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.");d=h.__html;null!==d&&void 0!==d&&("string"===typeof d&&0<d.length&&"\n"===d[0]?a.push("\n",d):a.push(""+d))}"string"===
-typeof g&&"\n"===g[0]&&a.push("\n");return g;case "area":case "br":case "col":case "embed":case "hr":case "img":case "keygen":case "param":case "source":case "track":case "wbr":return I(a,d,c,e);case "annotation-xml":case "color-profile":case "font-face":case "font-face-src":case "font-face-uri":case "font-face-format":case "font-face-name":case "missing-glyph":return J(a,d,c,e);case "head":return J(b,d,c,e);case "html":return 0===f.insertionMode&&b.push("<!DOCTYPE html>"),J(b,d,c,e);default:if(-1===
-c.indexOf("-")&&"string"!==typeof d.is)return J(a,d,c,e);a.push(G(c));h=g=null;for(q in d)if(r.call(d,q)&&(k=d[q],null!=k&&"function"!==typeof k&&"object"!==typeof k&&!1!==k))switch(!0===k&&(k=""),"className"===q&&(q="class"),q){case "children":g=k;break;case "dangerouslySetInnerHTML":h=k;break;case "style":Ma(a,e,k);break;case "suppressContentEditableWarning":case "suppressHydrationWarning":break;default:ia(q)&&"function"!==typeof k&&"symbol"!==typeof k&&a.push(" ",q,'="',w(k),'"')}a.push(">");D(a,
-h,g);return g}}function Ta(a,b,c){switch(c){case "title":case "script":case "area":case "base":case "br":case "col":case "embed":case "hr":case "img":case "input":case "keygen":case "link":case "meta":case "param":case "source":case "track":case "wbr":return;case "body":b.unshift("</",c,">");return;case "html":b.push("</",c,">");return}a.push("</",c,">")}
-function Ua(a,b,c){l(a,'\x3c!--$?--\x3e<template id="');if(null===c)throw Error("An ID must have been assigned before we can complete the boundary.");l(a,c);return!!a.write('"></template>')}
-function Va(a,b,c,d){switch(c.insertionMode){case 0:case 1:return l(a,'<div hidden id="'),l(a,b.segmentPrefix),l(a,d.toString(16)),!!a.write('">');case 2:return l(a,'<svg aria-hidden="true" style="display:none" id="'),l(a,b.segmentPrefix),l(a,d.toString(16)),!!a.write('">');case 3:return l(a,'<math aria-hidden="true" style="display:none" id="'),l(a,b.segmentPrefix),l(a,d.toString(16)),!!a.write('">');case 4:return l(a,'<table hidden id="'),l(a,b.segmentPrefix),l(a,d.toString(16)),!!a.write('">');
-case 5:return l(a,'<table hidden><tbody id="'),l(a,b.segmentPrefix),l(a,d.toString(16)),!!a.write('">');case 6:return l(a,'<table hidden><tr id="'),l(a,b.segmentPrefix),l(a,d.toString(16)),!!a.write('">');case 7:return l(a,'<table hidden><colgroup id="'),l(a,b.segmentPrefix),l(a,d.toString(16)),!!a.write('">');default:throw Error("Unknown insertion mode. This is a bug in React.");}}
-function Wa(a,b){switch(b.insertionMode){case 0:case 1:return!!a.write("</div>");case 2:return!!a.write("</svg>");case 3:return!!a.write("</math>");case 4:return!!a.write("</table>");case 5:return!!a.write("</tbody></table>");case 6:return!!a.write("</tr></table>");case 7:return!!a.write("</colgroup></table>");default:throw Error("Unknown insertion mode. This is a bug in React.");}}var Xa=/[<\u2028\u2029]/g;
-function Ya(a){return JSON.stringify(a).replace(Xa,function(a){switch(a){case "<":return"\\u003c";case "\u2028":return"\\u2028";case "\u2029":return"\\u2029";default:throw Error("escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React");}})}var Za=/[&><\u2028\u2029]/g;
-function K(a){return JSON.stringify(a).replace(Za,function(a){switch(a){case "&":return"\\u0026";case ">":return"\\u003e";case "<":return"\\u003c";case "\u2028":return"\\u2028";case "\u2029":return"\\u2029";default:throw Error("escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React");}})}
-function $a(a,b,c){function d(a){a.flushed||(F(e,a.props,c),a.flushed=!0)}var e=[],f=b.charset,g=b.bases,h=b.preconnects,m=b.fontPreloads,k=b.precedences,p=b.usedStylePreloads,n=b.scripts,q=b.usedScriptPreloads,u=b.explicitStylePreloads,H=b.explicitScriptPreloads,B=b.headResources;f&&(I(e,f.props,"meta",c),f.flushed=!0,b.charset=null);g.forEach(function(a){I(e,a.props,"base",c);a.flushed=!0});g.clear();h.forEach(function(a){F(e,a.props,c);a.flushed=!0});h.clear();m.forEach(function(a){F(e,a.props,
-c);a.flushed=!0});m.clear();k.forEach(function(a,b){a.size?(a.forEach(function(a){F(e,a.props,c);a.flushed=!0;a.inShell=!0;a.hint.flushed=!0}),a.clear()):e.push('<style data-precedence="',w(b),'"></style>')});p.forEach(d);p.clear();n.forEach(function(a){Pa(e,a.props,c);a.flushed=!0;a.hint.flushed=!0});n.clear();q.forEach(d);q.clear();u.forEach(d);u.clear();H.forEach(d);H.clear();B.forEach(function(a){switch(a.type){case "title":Oa(e,a.props,c);break;case "meta":I(e,a.props,"meta",c);break;case "link":F(e,
-a.props,c)}a.flushed=!0});B.clear();f=!0;for(b=0;b<e.length-1;b++)l(a,e[b]);b<e.length&&(f=!!a.write(e[b]));return f}
-function ab(a,b,c){function d(a){a.flushed||(F(e,a.props,c),a.flushed=!0)}var e=[],f=b.charset,g=b.preconnects,h=b.fontPreloads,m=b.usedStylePreloads,k=b.scripts,p=b.usedScriptPreloads,n=b.explicitStylePreloads,q=b.explicitScriptPreloads,u=b.headResources;f&&(I(e,f.props,"meta",c),f.flushed=!0,b.charset=null);g.forEach(function(a){F(e,a.props,c);a.flushed=!0});g.clear();h.forEach(function(a){F(e,a.props,c);a.flushed=!0});h.clear();m.forEach(d);m.clear();k.forEach(function(a){J(e,a.props,"script",
-c);Ta(e,e,"script",a.props);a.flushed=!0;a.hint.flushed=!0});k.clear();p.forEach(d);p.clear();n.forEach(d);n.clear();q.forEach(d);q.clear();u.forEach(function(a){switch(a.type){case "title":Oa(e,a.props,c);break;case "meta":I(e,a.props,"meta",c);break;case "link":F(e,a.props,c)}a.flushed=!0});u.clear();f=!0;for(b=0;b<e.length-1;b++)l(a,e[b]);b<e.length&&(f=!!a.write(e[b]));return f}
-function bb(a,b){l(a,"[");var c="[";b.forEach(function(b){if(!b.inShell)if(b.flushed)l(a,c),l(a,K(""+b.href)),l(a,"]"),c=",[";else{l(a,c);var d=b.precedence,f=b.props;l(a,K(""+b.href));d=""+d;l(a,",");l(a,K(d));for(var g in f)if(r.call(f,g)){var h=f[g];if(null!=h)switch(g){case "href":case "rel":case "precedence":case "data-precedence":break;case "children":case "dangerouslySetInnerHTML":throw Error("link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");
-default:a:{d=a;var m=g,k=m.toLowerCase();switch(typeof h){case "function":case "symbol":break a}switch(m){case "innerHTML":case "dangerouslySetInnerHTML":case "suppressContentEditableWarning":case "suppressHydrationWarning":case "style":break a;case "className":k="class";break;case "hidden":if(!1===h)break a;break;case "src":case "href":break;default:if(!ia(m))break a}if(!(2<m.length)||"o"!==m[0]&&"O"!==m[0]||"n"!==m[1]&&"N"!==m[1])h=""+h,l(d,","),l(d,K(k)),l(d,","),l(d,K(h))}}}l(a,"]");c=",[";b.flushed=
-!0;b.hint.flushed=!0}});l(a,"]")}
-var cb=Symbol.for("react.element"),db=Symbol.for("react.portal"),eb=Symbol.for("react.fragment"),fb=Symbol.for("react.strict_mode"),gb=Symbol.for("react.profiler"),hb=Symbol.for("react.provider"),ib=Symbol.for("react.context"),jb=Symbol.for("react.server_context"),kb=Symbol.for("react.forward_ref"),lb=Symbol.for("react.suspense"),mb=Symbol.for("react.suspense_list"),nb=Symbol.for("react.memo"),ob=Symbol.for("react.lazy"),pb=Symbol.for("react.scope"),qb=Symbol.for("react.debug_trace_mode"),rb=Symbol.for("react.offscreen"),
-sb=Symbol.for("react.legacy_hidden"),tb=Symbol.for("react.cache"),ub=Symbol.for("react.default_value"),vb=Symbol.for("react.memo_cache_sentinel"),wb=Symbol.iterator;
-function xb(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case eb:return"Fragment";case db:return"Portal";case gb:return"Profiler";case fb:return"StrictMode";case lb:return"Suspense";case mb:return"SuspenseList";case tb:return"Cache"}if("object"===typeof a)switch(a.$$typeof){case ib:return(a.displayName||"Context")+".Consumer";case hb:return(a._context.displayName||"Context")+".Provider";case kb:var b=a.render;a=a.displayName;
-a||(a=b.displayName||b.name||"",a=""!==a?"ForwardRef("+a+")":"ForwardRef");return a;case nb:return b=a.displayName||null,null!==b?b:xb(a.type)||"Memo";case ob:b=a._payload;a=a._init;try{return xb(a(b))}catch(c){break}case jb:return(a.displayName||a._globalName)+".Provider"}return null}var yb=ba.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,zb={};function Ab(a,b){a=a.contextTypes;if(!a)return zb;var c={},d;for(d in a)c[d]=b[d];return c}var L=null;
-function Bb(a,b){if(a!==b){a.context._currentValue=a.parentValue;a=a.parent;var c=b.parent;if(null===a){if(null!==c)throw Error("The stacks must reach the root at the same time. This is a bug in React.");}else{if(null===c)throw Error("The stacks must reach the root at the same time. This is a bug in React.");Bb(a,c)}b.context._currentValue=b.value}}function Cb(a){a.context._currentValue=a.parentValue;a=a.parent;null!==a&&Cb(a)}
-function Db(a){var b=a.parent;null!==b&&Db(b);a.context._currentValue=a.value}function Eb(a,b){a.context._currentValue=a.parentValue;a=a.parent;if(null===a)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===b.depth?Bb(a,b):Eb(a,b)}
-function Fb(a,b){var c=b.parent;if(null===c)throw Error("The depth must equal at least at zero before reaching the root. This is a bug in React.");a.depth===c.depth?Bb(a,c):Fb(a,c);b.context._currentValue=b.value}function Gb(a){var b=L;b!==a&&(null===b?Db(a):null===a?Cb(b):b.depth===a.depth?Bb(b,a):b.depth>a.depth?Eb(b,a):Fb(b,a),L=a)}
-var Hb={isMounted:function(){return!1},enqueueSetState:function(a,b){a=a._reactInternals;null!==a.queue&&a.queue.push(b)},enqueueReplaceState:function(a,b){a=a._reactInternals;a.replace=!0;a.queue=[b]},enqueueForceUpdate:function(){}};
-function Ib(a,b,c,d){var e=void 0!==a.state?a.state:null;a.updater=Hb;a.props=c;a.state=e;var f={queue:[],replace:!1};a._reactInternals=f;var g=b.contextType;a.context="object"===typeof g&&null!==g?g._currentValue:d;g=b.getDerivedStateFromProps;"function"===typeof g&&(g=g(c,e),e=null===g||void 0===g?e:x({},e,g),a.state=e);if("function"!==typeof b.getDerivedStateFromProps&&"function"!==typeof a.getSnapshotBeforeUpdate&&("function"===typeof a.UNSAFE_componentWillMount||"function"===typeof a.componentWillMount))if(b=
-a.state,"function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),b!==a.state&&Hb.enqueueReplaceState(a,a.state,null),null!==f.queue&&0<f.queue.length)if(b=f.queue,g=f.replace,f.queue=null,f.replace=!1,g&&1===b.length)a.state=b[0];else{f=g?b[0]:a.state;e=!0;for(g=g?1:0;g<b.length;g++){var h=b[g];h="function"===typeof h?h.call(a,f,c,d):h;null!=h&&(e?(e=!1,f=x({},f,h)):x(f,h))}a.state=f}else f.queue=null}
-var Jb={id:1,overflow:""};function Kb(a,b,c){var d=a.id;a=a.overflow;var e=32-Lb(d)-1;d&=~(1<<e);c+=1;var f=32-Lb(b)+e;if(30<f){var g=e-e%5;f=(d&(1<<g)-1).toString(32);d>>=g;e-=g;return{id:1<<32-Lb(b)+e|c<<e|d,overflow:f+a}}return{id:1<<f|c<<e|d,overflow:a}}var Lb=Math.clz32?Math.clz32:Mb,Nb=Math.log,Ob=Math.LN2;function Mb(a){a>>>=0;return 0===a?32:31-(Nb(a)/Ob|0)|0}var Pb=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`");
-function Qb(){}function Rb(a,b,c){c=a[c];void 0===c?a.push(b):c!==b&&(b.then(Qb,Qb),b=c);switch(b.status){case "fulfilled":return b.value;case "rejected":throw b.reason;default:if("string"!==typeof b.status)switch(a=b,a.status="pending",a.then(function(a){if("pending"===b.status){var c=b;c.status="fulfilled";c.value=a}},function(a){if("pending"===b.status){var c=b;c.status="rejected";c.reason=a}}),b.status){case "fulfilled":return b.value;case "rejected":throw b.reason;}Sb=b;throw Pb;}}var Sb=null;
-function Tb(){if(null===Sb)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var a=Sb;Sb=null;return a}function Ub(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var Vb="function"===typeof Object.is?Object.is:Ub,M=null,Wb=null,Xb=null,N=null,O=!1,Yb=!1,Q=0,R=0,S=null,T=null,Zb=0;
-function U(){if(null===M)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.");return M}
-function $b(){if(0<Zb)throw Error("Rendered more hooks than during the previous render");return{memoizedState:null,queue:null,next:null}}function ac(){null===N?null===Xb?(O=!1,Xb=N=$b()):(O=!0,N=Xb):null===N.next?(O=!1,N=N.next=$b()):(O=!0,N=N.next);return N}function bc(a,b,c,d){for(;Yb;)Yb=!1,R=Q=0,Zb+=1,N=null,c=a(b,d);cc();return c}function dc(){var a=S;S=null;return a}function cc(){Wb=M=null;Yb=!1;Xb=null;Zb=0;N=T=null}function ec(a,b){return"function"===typeof b?b(a):b}
-function fc(a,b,c){M=U();N=ac();if(O){var d=N.queue;b=d.dispatch;if(null!==T&&(c=T.get(d),void 0!==c)){T.delete(d);d=N.memoizedState;do d=a(d,c.action),c=c.next;while(null!==c);N.memoizedState=d;return[d,b]}return[N.memoizedState,b]}a=a===ec?"function"===typeof b?b():b:void 0!==c?c(b):b;N.memoizedState=a;a=N.queue={last:null,dispatch:null};a=a.dispatch=gc.bind(null,M,a);return[N.memoizedState,a]}
-function hc(a,b){M=U();N=ac();b=void 0===b?null:b;if(null!==N){var c=N.memoizedState;if(null!==c&&null!==b){var d=c[1];a:if(null===d)d=!1;else{for(var e=0;e<d.length&&e<b.length;e++)if(!Vb(b[e],d[e])){d=!1;break a}d=!0}if(d)return c[0]}}a=a();N.memoizedState=[a,b];return a}
-function gc(a,b,c){if(25<=Zb)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(a===M)if(Yb=!0,a={action:c,next:null},null===T&&(T=new Map),c=T.get(b),void 0===c)T.set(b,a);else{for(b=c;null!==b.next;)b=b.next;b.next=a}}function ic(){throw Error("A function wrapped in useEvent can't be called during rendering.");}function jc(){throw Error("startTransition cannot be called during server rendering.");}
-function kc(){throw Error("Cache cannot be refreshed during server rendering.");}function lc(){}
-var nc={readContext:function(a){return a._currentValue},useContext:function(a){U();return a._currentValue},useMemo:hc,useReducer:fc,useRef:function(a){M=U();N=ac();var b=N.memoizedState;return null===b?(a={current:a},N.memoizedState=a):b},useState:function(a){return fc(ec,a)},useInsertionEffect:lc,useLayoutEffect:function(){},useCallback:function(a,b){return hc(function(){return a},b)},useImperativeHandle:lc,useEffect:lc,useDebugValue:lc,useDeferredValue:function(a){U();return a},useTransition:function(){U();
-return[!1,jc]},useId:function(){var a=Wb.treeContext;var b=a.overflow;a=a.id;a=(a&~(1<<32-Lb(a)-1)).toString(32)+b;var c=mc;if(null===c)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component.");b=Q++;a=":"+c.idPrefix+"R"+a;0<b&&(a+="H"+b.toString(32));return a+":"},useMutableSource:function(a,b){U();return b(a._source)},useSyncExternalStore:function(a,b,c){if(void 0===c)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");
-return c()},useCacheRefresh:function(){return kc},useEvent:function(){return ic},useMemoCache:function(a){for(var b=Array(a),c=0;c<a;c++)b[c]=vb;return b},use:function(a){if(null!==a&&"object"===typeof a){if("function"===typeof a.then){var b=R;R+=1;null===S&&(S=[]);return Rb(S,a,b)}if(a.$$typeof===ib||a.$$typeof===jb)return a._currentValue}throw Error("An unsupported type was passed to use(): "+String(a));}},mc=null,oc={getCacheSignal:function(){throw Error("Not implemented.");},getCacheForType:function(){throw Error("Not implemented.");
-}},pc=yb.ReactCurrentDispatcher,qc=yb.ReactCurrentCache;function rc(a){console.error(a);return null}function W(){}
-function sc(a,b,c,d,e,f,g,h,m){var k=[],p=new Set,n={preloadsMap:new Map,stylesMap:new Map,scriptsMap:new Map,headsMap:new Map,charset:null,bases:new Set,preconnects:new Set,fontPreloads:new Set,precedences:new Map,usedStylePreloads:new Set,scripts:new Set,usedScriptPreloads:new Set,explicitStylePreloads:new Set,explicitScriptPreloads:new Set,headResources:new Set,structuredMetaKeys:new Map,boundaryResources:null};b={destination:null,responseState:b,progressiveChunkSize:void 0===d?12800:d,status:0,
-fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,resources:n,completedRootSegment:null,abortableTasks:p,pingedTasks:k,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],preamble:[],postamble:[],onError:void 0===e?rc:e,onAllReady:void 0===f?W:f,onShellReady:void 0===g?W:g,onShellError:void 0===h?W:h,onFatalError:void 0===m?W:m};c=tc(b,0,null,c,!1,!1);c.parentFlushed=!0;a=uc(b,null,a,null,c,p,zb,null,Jb);k.push(a);return b}
-function uc(a,b,c,d,e,f,g,h,m){a.allPendingTasks++;null===d?a.pendingRootTasks++:d.pendingTasks++;var k={node:c,ping:function(){var b=a.pingedTasks;b.push(k);1===b.length&&vc(a)},blockedBoundary:d,blockedSegment:e,abortSet:f,legacyContext:g,context:h,treeContext:m,thenableState:b};f.add(k);return k}function tc(a,b,c,d,e,f){return{status:0,id:-1,index:b,parentFlushed:!1,chunks:[],children:[],formatContext:d,boundary:c,lastPushedText:e,textEmbedded:f}}
-function X(a,b){a=a.onError(b);if(null!=a&&"string"!==typeof a)throw Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof a+'" instead');return a}function Y(a,b){var c=a.onShellError;c(b);c=a.onFatalError;c(b);null!==a.destination?(a.status=2,da(a.destination,b)):(a.status=1,a.fatalError=b)}
-function wc(a,b,c,d){var e=c.render(),f=d.childContextTypes;if(null!==f&&void 0!==f){var g=b.legacyContext;if("function"!==typeof c.getChildContext)d=g;else{c=c.getChildContext();for(var h in c)if(!(h in f))throw Error((xb(d)||"Unknown")+'.getChildContext(): key "'+h+'" is not defined in childContextTypes.');d=x({},g,c)}b.legacyContext=d;Z(a,b,null,e);b.legacyContext=g}else Z(a,b,null,e)}
-function xc(a,b){if(a&&a.defaultProps){b=x({},b);a=a.defaultProps;for(var c in a)void 0===b[c]&&(b[c]=a[c]);return b}return b}
-function yc(a,b,c,d,e,f){if("function"===typeof d)if(d.prototype&&d.prototype.isReactComponent)c=Ab(d,b.legacyContext),f=d.contextType,f=new d(e,"object"===typeof f&&null!==f?f._currentValue:c),Ib(f,d,e,c),wc(a,b,f,d);else{f=Ab(d,b.legacyContext);M={};Wb=b;R=Q=0;S=c;c=d(e,f);c=bc(d,e,c,f);var g=0!==Q;if("object"===typeof c&&null!==c&&"function"===typeof c.render&&void 0===c.$$typeof)Ib(c,d,e,f),wc(a,b,c,d);else if(g){e=b.treeContext;b.treeContext=Kb(e,1,0);try{Z(a,b,null,c)}finally{b.treeContext=
-e}}else Z(a,b,null,c)}else if("string"===typeof d)c=b.blockedSegment,f=Sa(c.chunks,a.preamble,d,e,a.responseState,c.formatContext,c.lastPushedText),c.lastPushedText=!1,g=c.formatContext,c.formatContext=Ja(g,d,e),zc(a,b,f),c.formatContext=g,Ta(c.chunks,a.postamble,d),c.lastPushedText=!1;else{switch(d){case sb:case qb:case fb:case gb:case eb:Z(a,b,null,e.children);return;case rb:"hidden"!==e.mode&&Z(a,b,null,e.children);return;case mb:Z(a,b,null,e.children);return;case pb:throw Error("ReactDOMServer does not yet support scope components.");
-case lb:a:{d=b.blockedBoundary;c=b.blockedSegment;f=e.fallback;e=e.children;g=new Set;var h={id:null,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:g,errorDigest:null,resources:new Set},m=tc(a,c.chunks.length,h,c.formatContext,!1,!1);c.children.push(m);c.lastPushedText=!1;var k=tc(a,0,null,c.formatContext,!1,!1);k.parentFlushed=!0;b.blockedBoundary=h;b.blockedSegment=k;a.resources.boundaryResources=h.resources;try{if(zc(a,
-b,e),k.lastPushedText&&k.textEmbedded&&k.chunks.push("\x3c!-- --\x3e"),k.status=1,0===h.pendingTasks&&(null!==a.completedRootSegment||0<a.pendingRootTasks)&&Da(a.resources,h.resources),Ac(h,k),0===h.pendingTasks)break a}catch(p){k.status=4,h.forceClientRender=!0,h.errorDigest=X(a,p)}finally{a.resources.boundaryResources=d?d.resources:null,b.blockedBoundary=d,b.blockedSegment=c}b=uc(a,null,f,d,m,g,b.legacyContext,b.context,b.treeContext);a.pingedTasks.push(b)}return}if("object"===typeof d&&null!==
-d)switch(d.$$typeof){case kb:d=d.render;M={};Wb=b;R=Q=0;S=c;c=d(e,f);e=bc(d,e,c,f);if(0!==Q){d=b.treeContext;b.treeContext=Kb(d,1,0);try{Z(a,b,null,e)}finally{b.treeContext=d}}else Z(a,b,null,e);return;case nb:d=d.type;e=xc(d,e);yc(a,b,c,d,e,f);return;case hb:c=e.children;d=d._context;e=e.value;f=d._currentValue;d._currentValue=e;g=L;L=e={parent:g,depth:null===g?0:g.depth+1,context:d,parentValue:f,value:e};b.context=e;Z(a,b,null,c);a=L;if(null===a)throw Error("Tried to pop a Context at the root of the app. This is a bug in React.");
-e=a.parentValue;a.context._currentValue=e===ub?a.context._defaultValue:e;a=L=a.parent;b.context=a;return;case ib:e=e.children;e=e(d._currentValue);Z(a,b,null,e);return;case ob:f=d._init;d=f(d._payload);e=xc(d,e);yc(a,b,c,d,e,void 0);return}throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+((null==d?d:typeof d)+"."));}}
-function Z(a,b,c,d){b.node=d;if("object"===typeof d&&null!==d){switch(d.$$typeof){case cb:yc(a,b,c,d.type,d.props,d.ref);return;case db:throw Error("Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.");case ob:c=d._init;d=c(d._payload);Z(a,b,null,d);return}if(ra(d)){Bc(a,b,d);return}null===d||"object"!==typeof d?c=null:(c=wb&&d[wb]||d["@@iterator"],c="function"===typeof c?c:null);if(c&&(c=c.call(d))){d=c.next();if(!d.done){var e=
-[];do e.push(d.value),d=c.next();while(!d.done);Bc(a,b,e)}return}a=Object.prototype.toString.call(d);throw Error("Objects are not valid as a React child (found: "+("[object Object]"===a?"object with keys {"+Object.keys(d).join(", ")+"}":a)+"). If you meant to render a collection of children, use an array instead.");}"string"===typeof d?(c=b.blockedSegment,c.lastPushedText=Ka(b.blockedSegment.chunks,d,a.responseState,c.lastPushedText)):"number"===typeof d&&(c=b.blockedSegment,c.lastPushedText=Ka(b.blockedSegment.chunks,
-""+d,a.responseState,c.lastPushedText))}function Bc(a,b,c){for(var d=c.length,e=0;e<d;e++){var f=b.treeContext;b.treeContext=Kb(f,d,e);try{zc(a,b,c[e])}finally{b.treeContext=f}}}
-function zc(a,b,c){var d=b.blockedSegment.formatContext,e=b.legacyContext,f=b.context;try{return Z(a,b,null,c)}catch(k){if(cc(),c=k===Pb?Tb():k,"object"===typeof c&&null!==c&&"function"===typeof c.then){var g=dc(),h=b.blockedSegment,m=tc(a,h.chunks.length,null,h.formatContext,h.lastPushedText,!0);h.children.push(m);h.lastPushedText=!1;a=uc(a,g,b.node,b.blockedBoundary,m,b.abortSet,b.legacyContext,b.context,b.treeContext).ping;c.then(a,a);b.blockedSegment.formatContext=d;b.legacyContext=e;b.context=
-f;Gb(f)}else throw b.blockedSegment.formatContext=d,b.legacyContext=e,b.context=f,Gb(f),c;}}function Cc(a){var b=a.blockedBoundary;a=a.blockedSegment;a.status=3;Dc(this,b,a)}
-function Ec(a,b,c){var d=a.blockedBoundary;a.blockedSegment.status=3;null===d?(b.allPendingTasks--,1!==b.status&&2!==b.status&&(X(b,c),Y(b,c))):(d.pendingTasks--,d.forceClientRender||(d.forceClientRender=!0,d.errorDigest=b.onError(c),d.parentFlushed&&b.clientRenderedBoundaries.push(d)),d.fallbackAbortableTasks.forEach(function(a){return Ec(a,b,c)}),d.fallbackAbortableTasks.clear(),b.allPendingTasks--,0===b.allPendingTasks&&(a=b.onAllReady,a()))}
-function Ac(a,b){if(0===b.chunks.length&&1===b.children.length&&null===b.children[0].boundary){var c=b.children[0];c.id=b.id;c.parentFlushed=!0;1===c.status&&Ac(a,c)}else a.completedSegments.push(b)}
-function Dc(a,b,c){if(null===b){if(c.parentFlushed){if(null!==a.completedRootSegment)throw Error("There can only be one root segment. This is a bug in React.");a.completedRootSegment=c}a.pendingRootTasks--;0===a.pendingRootTasks&&(a.onShellError=W,b=a.onShellReady,b())}else b.pendingTasks--,b.forceClientRender||(0===b.pendingTasks?(c.parentFlushed&&1===c.status&&Ac(b,c),(null!==a.completedRootSegment||0<a.pendingRootTasks)&&Da(a.resources,b.resources),b.parentFlushed&&a.completedBoundaries.push(b),
-b.fallbackAbortableTasks.forEach(Cc,a),b.fallbackAbortableTasks.clear()):c.parentFlushed&&1===c.status&&(Ac(b,c),1===b.completedSegments.length&&b.parentFlushed&&a.partialBoundaries.push(b)));a.allPendingTasks--;0===a.allPendingTasks&&(a=a.onAllReady,a())}
-function vc(a){if(2!==a.status){var b=L,c=pc.current;pc.current=nc;var d=qc.current;qc.current=oc;var e=a.resources;sa.push(y);y=e;e=Ea.current;Ea.current=va;var f=mc;mc=a.responseState;try{var g=a.pingedTasks,h;for(h=0;h<g.length;h++){var m=g[h];var k=a,p=m.blockedBoundary;k.resources.boundaryResources=p?p.resources:null;var n=m.blockedSegment;if(0===n.status){Gb(m.context);try{var q=m.thenableState;m.thenableState=null;Z(k,m,q,m.node);n.lastPushedText&&n.textEmbedded&&n.chunks.push("\x3c!-- --\x3e");
-m.abortSet.delete(m);n.status=1;Dc(k,m.blockedBoundary,n)}catch(aa){cc();var u=aa===Pb?Tb():aa;if("object"===typeof u&&null!==u&&"function"===typeof u.then){var H=m.ping;u.then(H,H);m.thenableState=dc()}else{m.abortSet.delete(m);n.status=4;var B=k,E=m.blockedBoundary,V=u,P=X(B,V);null===E?Y(B,V):(E.pendingTasks--,E.forceClientRender||(E.forceClientRender=!0,E.errorDigest=P,E.parentFlushed&&B.clientRenderedBoundaries.push(E)));B.allPendingTasks--;if(0===B.allPendingTasks){var Mc=B.onAllReady;Mc()}}}finally{k.resources.boundaryResources=
-null}}}g.splice(0,h);null!==a.destination&&Fc(a,a.destination)}catch(aa){X(a,aa),Y(a,aa)}finally{mc=f,pc.current=c,qc.current=d,y=sa.pop(),Ea.current=e,c===nc&&Gb(b)}}}
-function Gc(a,b,c){c.parentFlushed=!0;switch(c.status){case 0:var d=c.id=a.nextSegmentId++;c.lastPushedText=!1;c.textEmbedded=!1;a=a.responseState;l(b,'<template id="');l(b,a.placeholderPrefix);a=d.toString(16);l(b,a);return!!b.write('"></template>');case 1:c.status=2;var e=!0;d=c.chunks;var f=0;c=c.children;for(var g=0;g<c.length;g++){for(e=c[g];f<e.index;f++)l(b,d[f]);e=Hc(a,b,e)}for(;f<d.length-1;f++)l(b,d[f]);f<d.length&&(e=!!b.write(d[f]));return e;default:throw Error("Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.");
-}}
-function Hc(a,b,c){var d=c.boundary;if(null===d)return Gc(a,b,c);d.parentFlushed=!0;if(d.forceClientRender)d=d.errorDigest,b.write("\x3c!--$!--\x3e"),l(b,"<template"),d&&(l(b,' data-dgst="'),l(b,w(d)),l(b,'"')),b.write("></template>"),Gc(a,b,c);else if(0<d.pendingTasks){d.rootSegmentID=a.nextSegmentId++;0<d.completedSegments.length&&a.partialBoundaries.push(d);var e=a.responseState;var f=e.nextSuspenseID++;e=e.boundaryPrefix+f.toString(16);d=d.id=e;Ua(b,a.responseState,d);Gc(a,b,c)}else if(d.byteSize>a.progressiveChunkSize)d.rootSegmentID=
-a.nextSegmentId++,a.completedBoundaries.push(d),Ua(b,a.responseState,d.id),Gc(a,b,c);else{Ca(a.resources,d.resources);b.write("\x3c!--$--\x3e");c=d.completedSegments;if(1!==c.length)throw Error("A previously unvisited boundary must have exactly one root segment. This is a bug in React.");Hc(a,b,c[0])}return!!b.write("\x3c!--/$--\x3e")}function Ic(a,b,c){Va(b,a.responseState,c.formatContext,c.id);Hc(a,b,c);return Wa(b,c.formatContext)}
-function Jc(a,b,c){a.resources.boundaryResources=c.resources;for(var d=c.completedSegments,e=0;e<d.length;e++)Kc(a,b,c,d[e]);d.length=0;a=a.responseState;d=c.id;e=c.rootSegmentID;c=c.resources;var f;a:{for(f=c.values();;){var g=f.next().value;if(!g)break;if(!g.inShell){f=!0;break a}}f=!1}l(b,a.startInlineScript);f?a.sentCompleteBoundaryFunction?a.sentStyleInsertionFunction?l(b,'$RR("'):(a.sentStyleInsertionFunction=!0,l(b,'$RM=new Map;\n$RR=function(p,q,v){function r(l){this.s=l}for(var t=$RC,u=$RM,m=new Map,n=document,g,e,f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;e=f[d++];)m.set(e.dataset.precedence,g=e);e=0;f=[];for(var c,h,b,a;c=v[e++];){var k=0;h=c[k++];if(b=u.get(h))"l"!==b.s&&f.push(b);else{a=n.createElement("link");a.href=h;a.rel="stylesheet";for(a.dataset.precedence=d=c[k++];b=c[k++];)a.setAttribute(b,c[k++]);b=a._p=new Promise(function(l,w){a.onload=l;a.onerror=w});b.then(r.bind(b,\n"l"),r.bind(b,"e"));u.set(h,b);f.push(b);c=m.get(d)||g;c===g&&(g=a);m.set(d,a);c?c.parentNode.insertBefore(a,c.nextSibling):(d=n.head,d.insertBefore(a,d.firstChild))}}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};;$RR("')):
-(a.sentCompleteBoundaryFunction=!0,a.sentStyleInsertionFunction=!0,l(b,'$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};;$RM=new Map;\n$RR=function(p,q,v){function r(l){this.s=l}for(var t=$RC,u=$RM,m=new Map,n=document,g,e,f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;e=f[d++];)m.set(e.dataset.precedence,g=e);e=0;f=[];for(var c,h,b,a;c=v[e++];){var k=0;h=c[k++];if(b=u.get(h))"l"!==b.s&&f.push(b);else{a=n.createElement("link");a.href=h;a.rel="stylesheet";for(a.dataset.precedence=d=c[k++];b=c[k++];)a.setAttribute(b,c[k++]);b=a._p=new Promise(function(l,w){a.onload=l;a.onerror=w});b.then(r.bind(b,\n"l"),r.bind(b,"e"));u.set(h,b);f.push(b);c=m.get(d)||g;c===g&&(g=a);m.set(d,a);c?c.parentNode.insertBefore(a,c.nextSibling):(d=n.head,d.insertBefore(a,d.firstChild))}}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};;$RR("')):
-a.sentCompleteBoundaryFunction?l(b,'$RC("'):(a.sentCompleteBoundaryFunction=!0,l(b,'$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};;$RC("'));
-if(null===d)throw Error("An ID must have been assigned before we can complete the boundary.");e=e.toString(16);l(b,d);l(b,'","');l(b,a.segmentPrefix);l(b,e);f?(l(b,'",'),bb(b,c)):l(b,'"');return!!b.write(")\x3c/script>")}
-function Kc(a,b,c,d){if(2===d.status)return!0;var e=d.id;if(-1===e){if(-1===(d.id=c.rootSegmentID))throw Error("A root segment ID must have been assigned by now. This is a bug in React.");return Ic(a,b,d)}Ic(a,b,d);a=a.responseState;l(b,a.startInlineScript);a.sentCompleteSegmentFunction?l(b,'$RS("'):(a.sentCompleteSegmentFunction=!0,l(b,'$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};;$RS("'));
-l(b,a.segmentPrefix);e=e.toString(16);l(b,e);l(b,'","');l(b,a.placeholderPrefix);l(b,e);return!!b.write('")\x3c/script>')}
-function Fc(a,b){try{var c,d=a.completedRootSegment;if(null!==d)if(0===a.pendingRootTasks){var e=a.preamble;for(c=0;c<e.length;c++)l(b,e[c]);$a(b,a.resources,a.responseState);Hc(a,b,d);a.completedRootSegment=null;var f=a.responseState.bootstrapChunks;for(d=0;d<f.length-1;d++)l(b,f[d]);d<f.length&&b.write(f[d])}else return;else ab(b,a.resources,a.responseState);var g=a.clientRenderedBoundaries;for(c=0;c<g.length;c++){var h=g[c];f=b;var m=a.responseState,k=h.id,p=h.errorDigest,n=h.errorMessage,q=h.errorComponentStack;
-l(f,m.startInlineScript);m.sentClientRenderFunction?l(f,'$RX("'):(m.sentClientRenderFunction=!0,l(f,'$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};;$RX("'));if(null===k)throw Error("An ID must have been assigned before we can complete the boundary.");l(f,k);l(f,'"');if(p||n||q)l(f,","),l(f,Ya(p||""));if(n||q)l(f,","),l(f,Ya(n||""));q&&(l(f,","),l(f,Ya(q)));if(!f.write(")\x3c/script>")){a.destination=
-null;c++;g.splice(0,c);return}}g.splice(0,c);var u=a.completedBoundaries;for(c=0;c<u.length;c++)if(!Jc(a,b,u[c])){a.destination=null;c++;u.splice(0,c);return}u.splice(0,c);var H=a.partialBoundaries;for(c=0;c<H.length;c++){var B=H[c];a:{g=a;h=b;g.resources.boundaryResources=B.resources;var E=B.completedSegments;for(m=0;m<E.length;m++)if(!Kc(g,h,B,E[m])){m++;E.splice(0,m);var V=!1;break a}E.splice(0,m);V=!0}if(!V){a.destination=null;c++;H.splice(0,c);return}}H.splice(0,c);var P=a.completedBoundaries;
-for(c=0;c<P.length;c++)if(!Jc(a,b,P[c])){a.destination=null;c++;P.splice(0,c);return}P.splice(0,c)}finally{if(0===a.allPendingTasks&&0===a.pingedTasks.length&&0===a.clientRenderedBoundaries.length&&0===a.completedBoundaries.length){a=a.postamble;for(c=0;c<a.length;c++)l(b,a[c]);b.end()}}}
-function Lc(a,b){try{var c=a.abortableTasks;if(0<c.size){var d=void 0===b?Error("The render was aborted by the server without a reason."):b;c.forEach(function(b){return Ec(b,a,d)});c.clear()}null!==a.destination&&Fc(a,a.destination)}catch(e){X(a,e),Y(a,e)}}exports.renderToNodeStream=function(){throw Error("ReactDOMServer.renderToNodeStream(): The Node Stream API is not available in Bun. Use ReactDOMServer.renderToReadableStream() instead.");};
-exports.renderToReadableStream=function(a,b){return new Promise(function(c,d){var e,f,g=new Promise(function(a,b){f=a;e=b}),h=sc(a,Ha(b?b.identifierPrefix:void 0,b?b.nonce:void 0,b?b.bootstrapScriptContent:void 0,b?b.bootstrapScripts:void 0,b?b.bootstrapModules:void 0,b?b.unstable_externalRuntimeSrc:void 0),Ia(b?b.namespaceURI:void 0),b?b.progressiveChunkSize:void 0,b?b.onError:void 0,f,function(){var a=new ReadableStream({type:"direct",pull:function(a){if(1===h.status)h.status=2,da(a,h.fatalError);
-else if(2!==h.status&&null===h.destination){h.destination=a;try{Fc(h,a)}catch(q){X(h,q),Y(h,q)}}},cancel:function(){Lc(h)}},{highWaterMark:2048});a.allReady=g;c(a)},function(a){g.catch(function(){});d(a)},e);if(b&&b.signal){var m=b.signal;if(m.aborted)Lc(h,m.reason);else{var k=function(){Lc(h,m.reason);m.removeEventListener("abort",k)};m.addEventListener("abort",k)}}vc(h)})};
-exports.renderToStaticNodeStream=function(){throw Error("ReactDOMServer.renderToStaticNodeStream(): The Node Stream API is not available in Bun. Use ReactDOMServer.renderToReadableStream() instead.");};exports.version="18.2.0";
+"use strict";
+var ba = require("react"),
+ ca = require("react-dom");
+function l(a, b) {
+ 0 !== b.length && a.write(b);
+}
+function da(a, b) {
+ "function" === typeof a.error ? a.error(b) : a.close();
+}
+var r = Object.prototype.hasOwnProperty,
+ ea =
+ /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,
+ fa = {},
+ ha = {};
+function ia(a) {
+ if (r.call(ha, a)) return !0;
+ if (r.call(fa, a)) return !1;
+ if (ea.test(a)) return (ha[a] = !0);
+ fa[a] = !0;
+ return !1;
+}
+function t(a, b, c, d, e, f, g) {
+ this.acceptsBooleans = 2 === b || 3 === b || 4 === b;
+ this.attributeName = d;
+ this.attributeNamespace = e;
+ this.mustUseProperty = c;
+ this.propertyName = a;
+ this.type = b;
+ this.sanitizeURL = f;
+ this.removeEmptyString = g;
+}
+var v = {},
+ ja =
+ "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(
+ " "
+ );
+ja.push("innerText", "textContent");
+ja.forEach(function (a) {
+ v[a] = new t(a, 0, !1, a, null, !1, !1);
+});
+[
+ ["acceptCharset", "accept-charset"],
+ ["className", "class"],
+ ["htmlFor", "for"],
+ ["httpEquiv", "http-equiv"],
+].forEach(function (a) {
+ var b = a[0];
+ v[b] = new t(b, 1, !1, a[1], null, !1, !1);
+});
+["contentEditable", "draggable", "spellCheck", "value"].forEach(function (a) {
+ v[a] = new t(a, 2, !1, a.toLowerCase(), null, !1, !1);
+});
+[
+ "autoReverse",
+ "externalResourcesRequired",
+ "focusable",
+ "preserveAlpha",
+].forEach(function (a) {
+ v[a] = new t(a, 2, !1, a, null, !1, !1);
+});
+"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope"
+ .split(" ")
+ .forEach(function (a) {
+ v[a] = new t(a, 3, !1, a.toLowerCase(), null, !1, !1);
+ });
+["checked", "multiple", "muted", "selected"].forEach(function (a) {
+ v[a] = new t(a, 3, !0, a, null, !1, !1);
+});
+["capture", "download"].forEach(function (a) {
+ v[a] = new t(a, 4, !1, a, null, !1, !1);
+});
+["cols", "rows", "size", "span"].forEach(function (a) {
+ v[a] = new t(a, 6, !1, a, null, !1, !1);
+});
+["rowSpan", "start"].forEach(function (a) {
+ v[a] = new t(a, 5, !1, a.toLowerCase(), null, !1, !1);
+});
+var ka = /[\-:]([a-z])/g;
+function la(a) {
+ return a[1].toUpperCase();
+}
+"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height"
+ .split(" ")
+ .forEach(function (a) {
+ var b = a.replace(ka, la);
+ v[b] = new t(b, 1, !1, a, null, !1, !1);
+ });
+"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type"
+ .split(" ")
+ .forEach(function (a) {
+ var b = a.replace(ka, la);
+ v[b] = new t(b, 1, !1, a, "http://www.w3.org/1999/xlink", !1, !1);
+ });
+["xml:base", "xml:lang", "xml:space"].forEach(function (a) {
+ var b = a.replace(ka, la);
+ v[b] = new t(b, 1, !1, a, "http://www.w3.org/XML/1998/namespace", !1, !1);
+});
+["tabIndex", "crossOrigin"].forEach(function (a) {
+ v[a] = new t(a, 1, !1, a.toLowerCase(), null, !1, !1);
+});
+v.xlinkHref = new t(
+ "xlinkHref",
+ 1,
+ !1,
+ "xlink:href",
+ "http://www.w3.org/1999/xlink",
+ !0,
+ !1
+);
+["src", "href", "action", "formAction"].forEach(function (a) {
+ v[a] = new t(a, 1, !1, a.toLowerCase(), null, !0, !0);
+});
+var ma = {
+ animationIterationCount: !0,
+ aspectRatio: !0,
+ borderImageOutset: !0,
+ borderImageSlice: !0,
+ borderImageWidth: !0,
+ boxFlex: !0,
+ boxFlexGroup: !0,
+ boxOrdinalGroup: !0,
+ columnCount: !0,
+ columns: !0,
+ flex: !0,
+ flexGrow: !0,
+ flexPositive: !0,
+ flexShrink: !0,
+ flexNegative: !0,
+ flexOrder: !0,
+ gridArea: !0,
+ gridRow: !0,
+ gridRowEnd: !0,
+ gridRowSpan: !0,
+ gridRowStart: !0,
+ gridColumn: !0,
+ gridColumnEnd: !0,
+ gridColumnSpan: !0,
+ gridColumnStart: !0,
+ fontWeight: !0,
+ lineClamp: !0,
+ lineHeight: !0,
+ opacity: !0,
+ order: !0,
+ orphans: !0,
+ tabSize: !0,
+ widows: !0,
+ zIndex: !0,
+ zoom: !0,
+ fillOpacity: !0,
+ floodOpacity: !0,
+ stopOpacity: !0,
+ strokeDasharray: !0,
+ strokeDashoffset: !0,
+ strokeMiterlimit: !0,
+ strokeOpacity: !0,
+ strokeWidth: !0,
+ },
+ na = ["Webkit", "ms", "Moz", "O"];
+Object.keys(ma).forEach(function (a) {
+ na.forEach(function (b) {
+ b = b + a.charAt(0).toUpperCase() + a.substring(1);
+ ma[b] = ma[a];
+ });
+});
+var oa = /["'&<>]/;
+function w(a) {
+ if ("boolean" === typeof a || "number" === typeof a) return "" + a;
+ a = "" + a;
+ var b = oa.exec(a);
+ if (b) {
+ var c = "",
+ d,
+ e = 0;
+ for (d = b.index; d < a.length; d++) {
+ switch (a.charCodeAt(d)) {
+ case 34:
+ b = "&quot;";
+ break;
+ case 38:
+ b = "&amp;";
+ break;
+ case 39:
+ b = "&#x27;";
+ break;
+ case 60:
+ b = "&lt;";
+ break;
+ case 62:
+ b = "&gt;";
+ break;
+ default:
+ continue;
+ }
+ e !== d && (c += a.substring(e, d));
+ e = d + 1;
+ c += b;
+ }
+ a = e !== d ? c + a.substring(e, d) : c;
+ }
+ return a;
+}
+var pa = /([A-Z])/g,
+ qa = /^ms-/,
+ ra = Array.isArray,
+ x = Object.assign,
+ y = null,
+ sa = [],
+ va = { preload: ta, preinit: ua };
+function ta(a, b) {
+ if (y) {
+ var c = y;
+ if ("string" === typeof a && a && "object" === typeof b && null !== b) {
+ var d = b.as,
+ e = c.preloadsMap.get(a);
+ e ||
+ (e = z(c, a, d, {
+ href: a,
+ rel: "preload",
+ as: d,
+ crossOrigin: "font" === d ? "" : b.crossOrigin,
+ integrity: b.integrity,
+ }));
+ switch (d) {
+ case "font":
+ c.fontPreloads.add(e);
+ break;
+ case "style":
+ c.explicitStylePreloads.add(e);
+ break;
+ case "script":
+ c.explicitScriptPreloads.add(e);
+ }
+ }
+ }
+}
+function ua(a, b) {
+ if (y) {
+ var c = y;
+ if ("string" === typeof a && a && "object" === typeof b && null !== b)
+ switch (b.as) {
+ case "style":
+ var d = c.stylesMap.get(a);
+ d ||
+ ((d = b.precedence || "default"),
+ (d = wa(c, a, d, {
+ rel: "stylesheet",
+ href: a,
+ "data-precedence": d,
+ crossOrigin: b.crossOrigin,
+ })));
+ d.set.add(d);
+ c.explicitStylePreloads.add(d.hint);
+ break;
+ case "script":
+ (d = c.scriptsMap.get(a)),
+ d ||
+ ((d = xa(c, a, {
+ src: a,
+ async: !0,
+ crossOrigin: b.crossOrigin,
+ integrity: b.integrity,
+ })),
+ c.scripts.add(d));
+ }
+ }
+}
+function ya(a, b) {
+ return {
+ rel: "preload",
+ as: "style",
+ href: a,
+ crossOrigin: b.crossOrigin,
+ integrity: b.integrity,
+ media: b.media,
+ hrefLang: b.hrefLang,
+ referrerPolicy: b.referrerPolicy,
+ };
+}
+function za(a, b) {
+ return {
+ rel: "preload",
+ as: "script",
+ href: a,
+ crossOrigin: b.crossOrigin,
+ integrity: b.integrity,
+ referrerPolicy: b.referrerPolicy,
+ };
+}
+function z(a, b, c, d) {
+ c = { type: "preload", as: c, href: b, flushed: !1, props: d };
+ a.preloadsMap.set(b, c);
+ return c;
+}
+function wa(a, b, c, d) {
+ var e = a.stylesMap,
+ f = a.preloadsMap,
+ g = a.precedences,
+ h = g.get(c);
+ h || ((h = new Set()), g.set(c, h));
+ (f = f.get(b))
+ ? ((a = f.props),
+ null == d.crossOrigin && (d.crossOrigin = a.crossOrigin),
+ null == d.referrerPolicy && (d.referrerPolicy = a.referrerPolicy),
+ null == d.title && (d.title = a.title))
+ : ((f = ya(b, d)),
+ (f = z(a, b, "style", f)),
+ a.explicitStylePreloads.add(f));
+ c = {
+ type: "style",
+ href: b,
+ precedence: c,
+ flushed: !1,
+ inShell: !1,
+ props: d,
+ hint: f,
+ set: h,
+ };
+ e.set(b, c);
+ return c;
+}
+function xa(a, b, c) {
+ var d = a.scriptsMap,
+ e = a.preloadsMap.get(b);
+ e
+ ? ((a = e.props),
+ null == c.crossOrigin && (c.crossOrigin = a.crossOrigin),
+ null == c.referrerPolicy && (c.referrerPolicy = a.referrerPolicy),
+ null == c.integrity && (c.integrity = a.integrity))
+ : ((e = za(b, c)),
+ (e = z(a, b, "script", e)),
+ a.explicitScriptPreloads.add(e));
+ c = { type: "script", src: b, flushed: !1, props: c, hint: e };
+ d.set(b, c);
+ return c;
+}
+function Aa(a, b) {
+ if (!y)
+ throw Error(
+ '"currentResources" was expected to exist. This is a bug in React.'
+ );
+ var c = y;
+ switch (a) {
+ case "title":
+ var d = b.children;
+ Array.isArray(d) && 1 === d.length && (d = d[0]);
+ if ("string" === typeof d || "number" === typeof d) {
+ var e = "title::" + d;
+ a = c.headsMap.get(e);
+ a ||
+ ((b = x({}, b)),
+ (b.children = d),
+ (a = { type: "title", props: b, flushed: !1 }),
+ c.headsMap.set(e, a),
+ c.headResources.add(a));
+ }
+ return !0;
+ case "meta":
+ if ("string" === typeof b.charSet) e = "charSet";
+ else if ("string" === typeof b.content)
+ if (((a = "::" + b.content), "string" === typeof b.httpEquiv))
+ e = "httpEquiv::" + b.httpEquiv + a;
+ else if ("string" === typeof b.name) e = "name::" + b.name + a;
+ else if ("string" === typeof b.itemProp)
+ e = "itemProp::" + b.itemProp + a;
+ else if ("string" === typeof b.property) {
+ var f = b.property;
+ e = "property::" + f + a;
+ d = f;
+ a = f.split(":").slice(0, -1).join(":");
+ (a = c.structuredMetaKeys.get(a)) && (e = a.key + "::child::" + e);
+ }
+ e &&
+ !c.headsMap.has(e) &&
+ ((b = { type: "meta", key: e, props: x({}, b), flushed: !1 }),
+ c.headsMap.set(e, b),
+ "charSet" === e
+ ? (c.charset = b)
+ : (d && c.structuredMetaKeys.set(d, b), c.headResources.add(b)));
+ return !0;
+ case "base":
+ return (
+ (e = b.target),
+ (d = b.href),
+ (e =
+ "base" +
+ ("string" === typeof d ? '[href="' + d + '"]' : ":not([href])") +
+ ("string" === typeof e ? '[target="' + e + '"]' : ":not([target])")),
+ c.headsMap.has(e) ||
+ ((b = { type: "base", props: x({}, b), flushed: !1 }),
+ c.headsMap.set(e, b),
+ c.bases.add(b)),
+ !0
+ );
+ }
+ return !1;
+}
+function Ba(a) {
+ if (!y)
+ throw Error(
+ '"currentResources" was expected to exist. This is a bug in React.'
+ );
+ var b = y,
+ c = a.rel,
+ d = a.href;
+ if (!d || "string" !== typeof d || !c || "string" !== typeof c) return !1;
+ switch (c) {
+ case "stylesheet":
+ var e = a.onLoad,
+ f = a.onError;
+ c = a.precedence;
+ var g = a.disabled;
+ if ("string" !== typeof c || e || f || null != g)
+ return (
+ (c = b.preloadsMap.get(d)),
+ c || ((c = z(b, d, "style", ya(d, a))), b.usedStylePreloads.add(c)),
+ !1
+ );
+ e = b.stylesMap.get(d);
+ e ||
+ ((a = x({}, a)),
+ (a.href = d),
+ (a.rel = "stylesheet"),
+ (a["data-precedence"] = c),
+ delete a.precedence,
+ (e = wa(y, d, c, a)),
+ b.usedStylePreloads.add(e.hint));
+ b.boundaryResources ? b.boundaryResources.add(e) : e.set.add(e);
+ return !0;
+ case "preload":
+ switch (((e = a.as), e)) {
+ case "script":
+ case "style":
+ case "font":
+ c = b.preloadsMap.get(d);
+ if (!c)
+ switch (
+ ((a = x({}, a)),
+ (a.href = d),
+ (a.rel = "preload"),
+ (a.as = e),
+ "font" === e && (a.crossOrigin = ""),
+ (c = z(b, d, e, a)),
+ e)
+ ) {
+ case "script":
+ b.explicitScriptPreloads.add(c);
+ break;
+ case "style":
+ b.explicitStylePreloads.add(c);
+ break;
+ case "font":
+ b.fontPreloads.add(c);
+ }
+ return !0;
+ }
+ }
+ if (a.onLoad || a.onError) return !0;
+ d =
+ "rel:" +
+ c +
+ "::href:" +
+ d +
+ "::sizes:" +
+ ("string" === typeof a.sizes ? a.sizes : "") +
+ "::media:" +
+ ("string" === typeof a.media ? a.media : "");
+ e = b.headsMap.get(d);
+ if (!e)
+ switch (
+ ((e = { type: "link", props: x({}, a), flushed: !1 }),
+ b.headsMap.set(d, e),
+ c)
+ ) {
+ case "preconnect":
+ case "dns-prefetch":
+ b.preconnects.add(e);
+ break;
+ default:
+ b.headResources.add(e);
+ }
+ return !0;
+}
+function Ca(a, b) {
+ var c = a.boundaryResources;
+ c &&
+ (b.forEach(function (a) {
+ return c.add(a);
+ }),
+ b.clear());
+}
+function Da(a, b) {
+ b.forEach(function (a) {
+ return a.set.add(a);
+ });
+ b.clear();
+}
+var Ea = ca.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,
+ Fa = /(<\/|<)(s)(cript)/gi;
+function Ga(a, b, c, d) {
+ return "" + b + ("s" === c ? "\\u0073" : "\\u0053") + d;
+}
+function Ha(a, b, c, d, e) {
+ a = void 0 === a ? "" : a;
+ b = void 0 === b ? "<script>" : '<script nonce="' + w(b) + '">';
+ var f = [];
+ void 0 !== c && f.push(b, ("" + c).replace(Fa, Ga), "\x3c/script>");
+ if (void 0 !== d)
+ for (c = 0; c < d.length; c++) {
+ var g = d[c],
+ h = "string" === typeof g ? void 0 : g.integrity;
+ f.push('<script src="', w("string" === typeof g ? g : g.src));
+ h && f.push('" integrity="', w(h));
+ f.push('" async="">\x3c/script>');
+ }
+ if (void 0 !== e)
+ for (d = 0; d < e.length; d++)
+ (c = e[d]),
+ (g = "string" === typeof c ? void 0 : c.integrity),
+ f.push(
+ '<script type="module" src="',
+ w("string" === typeof c ? c : c.src)
+ ),
+ g && f.push('" integrity="', w(g)),
+ f.push('" async="">\x3c/script>');
+ return {
+ bootstrapChunks: f,
+ startInlineScript: b,
+ placeholderPrefix: a + "P:",
+ segmentPrefix: a + "S:",
+ boundaryPrefix: a + "B:",
+ idPrefix: a,
+ nextSuspenseID: 0,
+ sentCompleteSegmentFunction: !1,
+ sentCompleteBoundaryFunction: !1,
+ sentClientRenderFunction: !1,
+ sentStyleInsertionFunction: !1,
+ };
+}
+function A(a, b, c) {
+ return { insertionMode: a, selectedValue: b, noscriptTagInScope: c };
+}
+function Ia(a) {
+ return A(
+ "http://www.w3.org/2000/svg" === a
+ ? 2
+ : "http://www.w3.org/1998/Math/MathML" === a
+ ? 3
+ : 0,
+ null,
+ !1
+ );
+}
+function Ja(a, b, c) {
+ switch (b) {
+ case "noscript":
+ return A(1, null, !0);
+ case "select":
+ return A(
+ 1,
+ null != c.value ? c.value : c.defaultValue,
+ a.noscriptTagInScope
+ );
+ case "svg":
+ return A(2, null, a.noscriptTagInScope);
+ case "math":
+ return A(3, null, a.noscriptTagInScope);
+ case "foreignObject":
+ return A(1, null, a.noscriptTagInScope);
+ case "table":
+ return A(4, null, a.noscriptTagInScope);
+ case "thead":
+ case "tbody":
+ case "tfoot":
+ return A(5, null, a.noscriptTagInScope);
+ case "colgroup":
+ return A(7, null, a.noscriptTagInScope);
+ case "tr":
+ return A(6, null, a.noscriptTagInScope);
+ }
+ return 4 <= a.insertionMode || 0 === a.insertionMode
+ ? A(1, null, a.noscriptTagInScope)
+ : a;
+}
+function Ka(a, b, c, d) {
+ if ("" === b) return d;
+ d && a.push("\x3c!-- --\x3e");
+ a.push(w(b));
+ return !0;
+}
+var La = new Map();
+function Ma(a, b, c) {
+ if ("object" !== typeof c)
+ throw Error(
+ "The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX."
+ );
+ b = !0;
+ for (var d in c)
+ if (r.call(c, d)) {
+ var e = c[d];
+ if (null != e && "boolean" !== typeof e && "" !== e) {
+ if (0 === d.indexOf("--")) {
+ var f = w(d);
+ e = w(("" + e).trim());
+ } else {
+ f = d;
+ var g = La.get(f);
+ void 0 !== g
+ ? (f = g)
+ : ((g = w(f.replace(pa, "-$1").toLowerCase().replace(qa, "-ms-"))),
+ La.set(f, g),
+ (f = g));
+ e =
+ "number" === typeof e
+ ? 0 === e || r.call(ma, d)
+ ? "" + e
+ : e + "px"
+ : w(("" + e).trim());
+ }
+ b ? ((b = !1), a.push(' style="', f, ":", e)) : a.push(";", f, ":", e);
+ }
+ }
+ b || a.push('"');
+}
+function C(a, b, c, d) {
+ switch (c) {
+ case "style":
+ Ma(a, b, d);
+ return;
+ case "defaultValue":
+ case "defaultChecked":
+ case "innerHTML":
+ case "suppressContentEditableWarning":
+ case "suppressHydrationWarning":
+ return;
+ }
+ if (
+ !(2 < c.length) ||
+ ("o" !== c[0] && "O" !== c[0]) ||
+ ("n" !== c[1] && "N" !== c[1])
+ )
+ if (((b = v.hasOwnProperty(c) ? v[c] : null), null !== b)) {
+ switch (typeof d) {
+ case "function":
+ case "symbol":
+ return;
+ case "boolean":
+ if (!b.acceptsBooleans) return;
+ }
+ c = b.attributeName;
+ switch (b.type) {
+ case 3:
+ d && a.push(" ", c, '=""');
+ break;
+ case 4:
+ !0 === d
+ ? a.push(" ", c, '=""')
+ : !1 !== d && a.push(" ", c, '="', w(d), '"');
+ break;
+ case 5:
+ isNaN(d) || a.push(" ", c, '="', w(d), '"');
+ break;
+ case 6:
+ !isNaN(d) && 1 <= d && a.push(" ", c, '="', w(d), '"');
+ break;
+ default:
+ b.sanitizeURL && (d = "" + d), a.push(" ", c, '="', w(d), '"');
+ }
+ } else if (ia(c)) {
+ switch (typeof d) {
+ case "function":
+ case "symbol":
+ return;
+ case "boolean":
+ if (
+ ((b = c.toLowerCase().slice(0, 5)), "data-" !== b && "aria-" !== b)
+ )
+ return;
+ }
+ a.push(" ", c, '="', w(d), '"');
+ }
+}
+function D(a, b, c) {
+ if (null != b) {
+ if (null != c)
+ throw Error(
+ "Can only set one of `children` or `props.dangerouslySetInnerHTML`."
+ );
+ if ("object" !== typeof b || !("__html" in b))
+ throw Error(
+ "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information."
+ );
+ b = b.__html;
+ null !== b && void 0 !== b && a.push("" + b);
+ }
+}
+function Na(a) {
+ var b = "";
+ ba.Children.forEach(a, function (a) {
+ null != a && (b += a);
+ });
+ return b;
+}
+function F(a, b, c) {
+ var d = "stylesheet" === b.rel;
+ a.push(G("link"));
+ for (var e in b)
+ if (r.call(b, e)) {
+ var f = b[e];
+ if (null != f)
+ switch (e) {
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw Error(
+ "link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
+ );
+ case "precedence":
+ if (d) continue;
+ default:
+ C(a, c, e, f);
+ }
+ }
+ a.push("/>");
+ return null;
+}
+function I(a, b, c, d) {
+ a.push(G(c));
+ for (var e in b)
+ if (r.call(b, e)) {
+ var f = b[e];
+ if (null != f)
+ switch (e) {
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw Error(
+ c +
+ " is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
+ );
+ default:
+ C(a, d, e, f);
+ }
+ }
+ a.push("/>");
+ return null;
+}
+function Oa(a, b, c) {
+ a.push(G("title"));
+ var d = null,
+ e;
+ for (e in b)
+ if (r.call(b, e)) {
+ var f = b[e];
+ if (null != f)
+ switch (e) {
+ case "children":
+ d = f;
+ break;
+ case "dangerouslySetInnerHTML":
+ throw Error(
+ "`dangerouslySetInnerHTML` does not make sense on <title>."
+ );
+ default:
+ C(a, c, e, f);
+ }
+ }
+ a.push(">");
+ b = Array.isArray(d) && 2 > d.length ? d[0] || null : d;
+ ("string" !== typeof b && "number" !== typeof b) || a.push(w(b));
+ a.push("</", "title", ">");
+ return null;
+}
+function Pa(a, b, c) {
+ a.push(G("script"));
+ var d = null,
+ e = null,
+ f;
+ for (f in b)
+ if (r.call(b, f)) {
+ var g = b[f];
+ if (null != g)
+ switch (f) {
+ case "children":
+ d = g;
+ break;
+ case "dangerouslySetInnerHTML":
+ e = g;
+ break;
+ default:
+ C(a, c, f, g);
+ }
+ }
+ a.push(">");
+ D(a, e, d);
+ "string" === typeof d && a.push(w(d));
+ a.push("</", "script", ">");
+ return null;
+}
+function J(a, b, c, d) {
+ a.push(G(c));
+ var e = (c = null),
+ f;
+ for (f in b)
+ if (r.call(b, f)) {
+ var g = b[f];
+ if (null != g)
+ switch (f) {
+ case "children":
+ c = g;
+ break;
+ case "dangerouslySetInnerHTML":
+ e = g;
+ break;
+ default:
+ C(a, d, f, g);
+ }
+ }
+ a.push(">");
+ D(a, e, c);
+ return "string" === typeof c ? (a.push(w(c)), null) : c;
+}
+var Qa = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,
+ Ra = new Map();
+function G(a) {
+ var b = Ra.get(a);
+ if (void 0 === b) {
+ if (!Qa.test(a)) throw Error("Invalid tag: " + a);
+ b = "<" + a;
+ Ra.set(a, b);
+ }
+ return b;
+}
+function Sa(a, b, c, d, e, f, g) {
+ switch (c) {
+ case "select":
+ a.push(G("select"));
+ var h = (g = null),
+ m;
+ for (m in d)
+ if (r.call(d, m)) {
+ var k = d[m];
+ if (null != k)
+ switch (m) {
+ case "children":
+ g = k;
+ break;
+ case "dangerouslySetInnerHTML":
+ h = k;
+ break;
+ case "defaultValue":
+ case "value":
+ break;
+ default:
+ C(a, e, m, k);
+ }
+ }
+ a.push(">");
+ D(a, h, g);
+ return g;
+ case "option":
+ g = f.selectedValue;
+ a.push(G("option"));
+ var p = (m = k = null),
+ n = null;
+ for (h in d)
+ if (r.call(d, h)) {
+ var q = d[h];
+ if (null != q)
+ switch (h) {
+ case "children":
+ k = q;
+ break;
+ case "selected":
+ p = q;
+ break;
+ case "dangerouslySetInnerHTML":
+ n = q;
+ break;
+ case "value":
+ m = q;
+ default:
+ C(a, e, h, q);
+ }
+ }
+ if (null != g)
+ if (((d = null !== m ? "" + m : Na(k)), ra(g)))
+ for (e = 0; e < g.length; e++) {
+ if ("" + g[e] === d) {
+ a.push(' selected=""');
+ break;
+ }
+ }
+ else "" + g === d && a.push(' selected=""');
+ else p && a.push(' selected=""');
+ a.push(">");
+ D(a, n, k);
+ return k;
+ case "textarea":
+ a.push(G("textarea"));
+ k = h = g = null;
+ for (n in d)
+ if (r.call(d, n) && ((m = d[n]), null != m))
+ switch (n) {
+ case "children":
+ k = m;
+ break;
+ case "value":
+ g = m;
+ break;
+ case "defaultValue":
+ h = m;
+ break;
+ case "dangerouslySetInnerHTML":
+ throw Error(
+ "`dangerouslySetInnerHTML` does not make sense on <textarea>."
+ );
+ default:
+ C(a, e, n, m);
+ }
+ null === g && null !== h && (g = h);
+ a.push(">");
+ if (null != k) {
+ if (null != g)
+ throw Error(
+ "If you supply `defaultValue` on a <textarea>, do not pass children."
+ );
+ if (ra(k) && 1 < k.length)
+ throw Error("<textarea> can only have at most one child.");
+ g = "" + k;
+ }
+ "string" === typeof g && "\n" === g[0] && a.push("\n");
+ null !== g && a.push(w("" + g));
+ return null;
+ case "input":
+ a.push(G("input"));
+ m = n = h = g = null;
+ for (k in d)
+ if (r.call(d, k) && ((p = d[k]), null != p))
+ switch (k) {
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw Error(
+ "input is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
+ );
+ case "defaultChecked":
+ m = p;
+ break;
+ case "defaultValue":
+ h = p;
+ break;
+ case "checked":
+ n = p;
+ break;
+ case "value":
+ g = p;
+ break;
+ default:
+ C(a, e, k, p);
+ }
+ null !== n ? C(a, e, "checked", n) : null !== m && C(a, e, "checked", m);
+ null !== g ? C(a, e, "value", g) : null !== h && C(a, e, "value", h);
+ a.push("/>");
+ return null;
+ case "menuitem":
+ a.push(G("menuitem"));
+ for (var u in d)
+ if (r.call(d, u) && ((g = d[u]), null != g))
+ switch (u) {
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw Error(
+ "menuitems cannot have `children` nor `dangerouslySetInnerHTML`."
+ );
+ default:
+ C(a, e, u, g);
+ }
+ a.push(">");
+ return null;
+ case "title":
+ return (
+ (a =
+ 2 !== f.insertionMode && !f.noscriptTagInScope && Aa("title", d)
+ ? null
+ : Oa(a, d, e)),
+ a
+ );
+ case "link":
+ return (
+ !f.noscriptTagInScope && Ba(d)
+ ? (g && a.push("\x3c!-- --\x3e"), (a = null))
+ : (a = F(a, d, e)),
+ a
+ );
+ case "script":
+ if ((h = !f.noscriptTagInScope)) {
+ if (!y)
+ throw Error(
+ '"currentResources" was expected to exist. This is a bug in React.'
+ );
+ h = y;
+ k = d.src;
+ n = d.onLoad;
+ m = d.onError;
+ k && "string" === typeof k
+ ? d.async
+ ? (n || m
+ ? ((n = h.preloadsMap.get(k)),
+ n ||
+ ((n = z(h, k, "script", za(k, d))),
+ h.usedScriptPreloads.add(n)))
+ : ((n = h.scriptsMap.get(k)),
+ n ||
+ ((n = x({}, d)),
+ (n.src = k),
+ (n = xa(h, k, n)),
+ h.scripts.add(n))),
+ (h = !0))
+ : (h = !1)
+ : (h = !1);
+ }
+ h ? (g && a.push("\x3c!-- --\x3e"), (a = null)) : (a = Pa(a, d, e));
+ return a;
+ case "meta":
+ return (
+ !f.noscriptTagInScope && Aa("meta", d)
+ ? (g && a.push("\x3c!-- --\x3e"), (a = null))
+ : (a = I(a, d, "meta", e)),
+ a
+ );
+ case "base":
+ return (
+ !f.noscriptTagInScope && Aa("base", d)
+ ? (g && a.push("\x3c!-- --\x3e"), (a = null))
+ : (a = I(a, d, "base", e)),
+ a
+ );
+ case "listing":
+ case "pre":
+ a.push(G(c));
+ h = g = null;
+ for (p in d)
+ if (r.call(d, p) && ((k = d[p]), null != k))
+ switch (p) {
+ case "children":
+ g = k;
+ break;
+ case "dangerouslySetInnerHTML":
+ h = k;
+ break;
+ default:
+ C(a, e, p, k);
+ }
+ a.push(">");
+ if (null != h) {
+ if (null != g)
+ throw Error(
+ "Can only set one of `children` or `props.dangerouslySetInnerHTML`."
+ );
+ if ("object" !== typeof h || !("__html" in h))
+ throw Error(
+ "`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information."
+ );
+ d = h.__html;
+ null !== d &&
+ void 0 !== d &&
+ ("string" === typeof d && 0 < d.length && "\n" === d[0]
+ ? a.push("\n", d)
+ : a.push("" + d));
+ }
+ "string" === typeof g && "\n" === g[0] && a.push("\n");
+ return g;
+ case "area":
+ case "br":
+ case "col":
+ case "embed":
+ case "hr":
+ case "img":
+ case "keygen":
+ case "param":
+ case "source":
+ case "track":
+ case "wbr":
+ return I(a, d, c, e);
+ case "annotation-xml":
+ case "color-profile":
+ case "font-face":
+ case "font-face-src":
+ case "font-face-uri":
+ case "font-face-format":
+ case "font-face-name":
+ case "missing-glyph":
+ return J(a, d, c, e);
+ case "head":
+ return J(b, d, c, e);
+ case "html":
+ return 0 === f.insertionMode && b.push("<!DOCTYPE html>"), J(b, d, c, e);
+ default:
+ if (-1 === c.indexOf("-") && "string" !== typeof d.is)
+ return J(a, d, c, e);
+ a.push(G(c));
+ h = g = null;
+ for (q in d)
+ if (
+ r.call(d, q) &&
+ ((k = d[q]),
+ null != k &&
+ "function" !== typeof k &&
+ "object" !== typeof k &&
+ !1 !== k)
+ )
+ switch (
+ (!0 === k && (k = ""), "className" === q && (q = "class"), q)
+ ) {
+ case "children":
+ g = k;
+ break;
+ case "dangerouslySetInnerHTML":
+ h = k;
+ break;
+ case "style":
+ Ma(a, e, k);
+ break;
+ case "suppressContentEditableWarning":
+ case "suppressHydrationWarning":
+ break;
+ default:
+ ia(q) &&
+ "function" !== typeof k &&
+ "symbol" !== typeof k &&
+ a.push(" ", q, '="', w(k), '"');
+ }
+ a.push(">");
+ D(a, h, g);
+ return g;
+ }
+}
+function Ta(a, b, c) {
+ switch (c) {
+ case "title":
+ case "script":
+ case "area":
+ case "base":
+ case "br":
+ case "col":
+ case "embed":
+ case "hr":
+ case "img":
+ case "input":
+ case "keygen":
+ case "link":
+ case "meta":
+ case "param":
+ case "source":
+ case "track":
+ case "wbr":
+ return;
+ case "body":
+ b.unshift("</", c, ">");
+ return;
+ case "html":
+ b.push("</", c, ">");
+ return;
+ }
+ a.push("</", c, ">");
+}
+function Ua(a, b, c) {
+ l(a, '\x3c!--$?--\x3e<template id="');
+ if (null === c)
+ throw Error(
+ "An ID must have been assigned before we can complete the boundary."
+ );
+ l(a, c);
+ return !!a.write('"></template>');
+}
+function Va(a, b, c, d) {
+ switch (c.insertionMode) {
+ case 0:
+ case 1:
+ return (
+ l(a, '<div hidden id="'),
+ l(a, b.segmentPrefix),
+ l(a, d.toString(16)),
+ !!a.write('">')
+ );
+ case 2:
+ return (
+ l(a, '<svg aria-hidden="true" style="display:none" id="'),
+ l(a, b.segmentPrefix),
+ l(a, d.toString(16)),
+ !!a.write('">')
+ );
+ case 3:
+ return (
+ l(a, '<math aria-hidden="true" style="display:none" id="'),
+ l(a, b.segmentPrefix),
+ l(a, d.toString(16)),
+ !!a.write('">')
+ );
+ case 4:
+ return (
+ l(a, '<table hidden id="'),
+ l(a, b.segmentPrefix),
+ l(a, d.toString(16)),
+ !!a.write('">')
+ );
+ case 5:
+ return (
+ l(a, '<table hidden><tbody id="'),
+ l(a, b.segmentPrefix),
+ l(a, d.toString(16)),
+ !!a.write('">')
+ );
+ case 6:
+ return (
+ l(a, '<table hidden><tr id="'),
+ l(a, b.segmentPrefix),
+ l(a, d.toString(16)),
+ !!a.write('">')
+ );
+ case 7:
+ return (
+ l(a, '<table hidden><colgroup id="'),
+ l(a, b.segmentPrefix),
+ l(a, d.toString(16)),
+ !!a.write('">')
+ );
+ default:
+ throw Error("Unknown insertion mode. This is a bug in React.");
+ }
+}
+function Wa(a, b) {
+ switch (b.insertionMode) {
+ case 0:
+ case 1:
+ return !!a.write("</div>");
+ case 2:
+ return !!a.write("</svg>");
+ case 3:
+ return !!a.write("</math>");
+ case 4:
+ return !!a.write("</table>");
+ case 5:
+ return !!a.write("</tbody></table>");
+ case 6:
+ return !!a.write("</tr></table>");
+ case 7:
+ return !!a.write("</colgroup></table>");
+ default:
+ throw Error("Unknown insertion mode. This is a bug in React.");
+ }
+}
+var Xa = /[<\u2028\u2029]/g;
+function Ya(a) {
+ return JSON.stringify(a).replace(Xa, function (a) {
+ switch (a) {
+ case "<":
+ return "\\u003c";
+ case "\u2028":
+ return "\\u2028";
+ case "\u2029":
+ return "\\u2029";
+ default:
+ throw Error(
+ "escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
+ );
+ }
+ });
+}
+var Za = /[&><\u2028\u2029]/g;
+function K(a) {
+ return JSON.stringify(a).replace(Za, function (a) {
+ switch (a) {
+ case "&":
+ return "\\u0026";
+ case ">":
+ return "\\u003e";
+ case "<":
+ return "\\u003c";
+ case "\u2028":
+ return "\\u2028";
+ case "\u2029":
+ return "\\u2029";
+ default:
+ throw Error(
+ "escapeJSObjectForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
+ );
+ }
+ });
+}
+function $a(a, b, c) {
+ function d(a) {
+ a.flushed || (F(e, a.props, c), (a.flushed = !0));
+ }
+ var e = [],
+ f = b.charset,
+ g = b.bases,
+ h = b.preconnects,
+ m = b.fontPreloads,
+ k = b.precedences,
+ p = b.usedStylePreloads,
+ n = b.scripts,
+ q = b.usedScriptPreloads,
+ u = b.explicitStylePreloads,
+ H = b.explicitScriptPreloads,
+ B = b.headResources;
+ f && (I(e, f.props, "meta", c), (f.flushed = !0), (b.charset = null));
+ g.forEach(function (a) {
+ I(e, a.props, "base", c);
+ a.flushed = !0;
+ });
+ g.clear();
+ h.forEach(function (a) {
+ F(e, a.props, c);
+ a.flushed = !0;
+ });
+ h.clear();
+ m.forEach(function (a) {
+ F(e, a.props, c);
+ a.flushed = !0;
+ });
+ m.clear();
+ k.forEach(function (a, b) {
+ a.size
+ ? (a.forEach(function (a) {
+ F(e, a.props, c);
+ a.flushed = !0;
+ a.inShell = !0;
+ a.hint.flushed = !0;
+ }),
+ a.clear())
+ : e.push('<style data-precedence="', w(b), '"></style>');
+ });
+ p.forEach(d);
+ p.clear();
+ n.forEach(function (a) {
+ Pa(e, a.props, c);
+ a.flushed = !0;
+ a.hint.flushed = !0;
+ });
+ n.clear();
+ q.forEach(d);
+ q.clear();
+ u.forEach(d);
+ u.clear();
+ H.forEach(d);
+ H.clear();
+ B.forEach(function (a) {
+ switch (a.type) {
+ case "title":
+ Oa(e, a.props, c);
+ break;
+ case "meta":
+ I(e, a.props, "meta", c);
+ break;
+ case "link":
+ F(e, a.props, c);
+ }
+ a.flushed = !0;
+ });
+ B.clear();
+ f = !0;
+ for (b = 0; b < e.length - 1; b++) l(a, e[b]);
+ b < e.length && (f = !!a.write(e[b]));
+ return f;
+}
+function ab(a, b, c) {
+ function d(a) {
+ a.flushed || (F(e, a.props, c), (a.flushed = !0));
+ }
+ var e = [],
+ f = b.charset,
+ g = b.preconnects,
+ h = b.fontPreloads,
+ m = b.usedStylePreloads,
+ k = b.scripts,
+ p = b.usedScriptPreloads,
+ n = b.explicitStylePreloads,
+ q = b.explicitScriptPreloads,
+ u = b.headResources;
+ f && (I(e, f.props, "meta", c), (f.flushed = !0), (b.charset = null));
+ g.forEach(function (a) {
+ F(e, a.props, c);
+ a.flushed = !0;
+ });
+ g.clear();
+ h.forEach(function (a) {
+ F(e, a.props, c);
+ a.flushed = !0;
+ });
+ h.clear();
+ m.forEach(d);
+ m.clear();
+ k.forEach(function (a) {
+ J(e, a.props, "script", c);
+ Ta(e, e, "script", a.props);
+ a.flushed = !0;
+ a.hint.flushed = !0;
+ });
+ k.clear();
+ p.forEach(d);
+ p.clear();
+ n.forEach(d);
+ n.clear();
+ q.forEach(d);
+ q.clear();
+ u.forEach(function (a) {
+ switch (a.type) {
+ case "title":
+ Oa(e, a.props, c);
+ break;
+ case "meta":
+ I(e, a.props, "meta", c);
+ break;
+ case "link":
+ F(e, a.props, c);
+ }
+ a.flushed = !0;
+ });
+ u.clear();
+ f = !0;
+ for (b = 0; b < e.length - 1; b++) l(a, e[b]);
+ b < e.length && (f = !!a.write(e[b]));
+ return f;
+}
+function bb(a, b) {
+ l(a, "[");
+ var c = "[";
+ b.forEach(function (b) {
+ if (!b.inShell)
+ if (b.flushed) l(a, c), l(a, K("" + b.href)), l(a, "]"), (c = ",[");
+ else {
+ l(a, c);
+ var d = b.precedence,
+ f = b.props;
+ l(a, K("" + b.href));
+ d = "" + d;
+ l(a, ",");
+ l(a, K(d));
+ for (var g in f)
+ if (r.call(f, g)) {
+ var h = f[g];
+ if (null != h)
+ switch (g) {
+ case "href":
+ case "rel":
+ case "precedence":
+ case "data-precedence":
+ break;
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw Error(
+ "link is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`."
+ );
+ default:
+ a: {
+ d = a;
+ var m = g,
+ k = m.toLowerCase();
+ switch (typeof h) {
+ case "function":
+ case "symbol":
+ break a;
+ }
+ switch (m) {
+ case "innerHTML":
+ case "dangerouslySetInnerHTML":
+ case "suppressContentEditableWarning":
+ case "suppressHydrationWarning":
+ case "style":
+ break a;
+ case "className":
+ k = "class";
+ break;
+ case "hidden":
+ if (!1 === h) break a;
+ break;
+ case "src":
+ case "href":
+ break;
+ default:
+ if (!ia(m)) break a;
+ }
+ if (
+ !(2 < m.length) ||
+ ("o" !== m[0] && "O" !== m[0]) ||
+ ("n" !== m[1] && "N" !== m[1])
+ )
+ (h = "" + h),
+ l(d, ","),
+ l(d, K(k)),
+ l(d, ","),
+ l(d, K(h));
+ }
+ }
+ }
+ l(a, "]");
+ c = ",[";
+ b.flushed = !0;
+ b.hint.flushed = !0;
+ }
+ });
+ l(a, "]");
+}
+var cb = Symbol.for("react.element"),
+ db = Symbol.for("react.portal"),
+ eb = Symbol.for("react.fragment"),
+ fb = Symbol.for("react.strict_mode"),
+ gb = Symbol.for("react.profiler"),
+ hb = Symbol.for("react.provider"),
+ ib = Symbol.for("react.context"),
+ jb = Symbol.for("react.server_context"),
+ kb = Symbol.for("react.forward_ref"),
+ lb = Symbol.for("react.suspense"),
+ mb = Symbol.for("react.suspense_list"),
+ nb = Symbol.for("react.memo"),
+ ob = Symbol.for("react.lazy"),
+ pb = Symbol.for("react.scope"),
+ qb = Symbol.for("react.debug_trace_mode"),
+ rb = Symbol.for("react.offscreen"),
+ sb = Symbol.for("react.legacy_hidden"),
+ tb = Symbol.for("react.cache"),
+ ub = Symbol.for("react.default_value"),
+ vb = Symbol.for("react.memo_cache_sentinel"),
+ wb = Symbol.iterator;
+function xb(a) {
+ if (null == a) return null;
+ if ("function" === typeof a) return a.displayName || a.name || null;
+ if ("string" === typeof a) return a;
+ switch (a) {
+ case eb:
+ return "Fragment";
+ case db:
+ return "Portal";
+ case gb:
+ return "Profiler";
+ case fb:
+ return "StrictMode";
+ case lb:
+ return "Suspense";
+ case mb:
+ return "SuspenseList";
+ case tb:
+ return "Cache";
+ }
+ if ("object" === typeof a)
+ switch (a.$$typeof) {
+ case ib:
+ return (a.displayName || "Context") + ".Consumer";
+ case hb:
+ return (a._context.displayName || "Context") + ".Provider";
+ case kb:
+ var b = a.render;
+ a = a.displayName;
+ a ||
+ ((a = b.displayName || b.name || ""),
+ (a = "" !== a ? "ForwardRef(" + a + ")" : "ForwardRef"));
+ return a;
+ case nb:
+ return (
+ (b = a.displayName || null), null !== b ? b : xb(a.type) || "Memo"
+ );
+ case ob:
+ b = a._payload;
+ a = a._init;
+ try {
+ return xb(a(b));
+ } catch (c) {
+ break;
+ }
+ case jb:
+ return (a.displayName || a._globalName) + ".Provider";
+ }
+ return null;
+}
+var yb = ba.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
+ zb = {};
+function Ab(a, b) {
+ a = a.contextTypes;
+ if (!a) return zb;
+ var c = {},
+ d;
+ for (d in a) c[d] = b[d];
+ return c;
+}
+var L = null;
+function Bb(a, b) {
+ if (a !== b) {
+ a.context._currentValue = a.parentValue;
+ a = a.parent;
+ var c = b.parent;
+ if (null === a) {
+ if (null !== c)
+ throw Error(
+ "The stacks must reach the root at the same time. This is a bug in React."
+ );
+ } else {
+ if (null === c)
+ throw Error(
+ "The stacks must reach the root at the same time. This is a bug in React."
+ );
+ Bb(a, c);
+ }
+ b.context._currentValue = b.value;
+ }
+}
+function Cb(a) {
+ a.context._currentValue = a.parentValue;
+ a = a.parent;
+ null !== a && Cb(a);
+}
+function Db(a) {
+ var b = a.parent;
+ null !== b && Db(b);
+ a.context._currentValue = a.value;
+}
+function Eb(a, b) {
+ a.context._currentValue = a.parentValue;
+ a = a.parent;
+ if (null === a)
+ throw Error(
+ "The depth must equal at least at zero before reaching the root. This is a bug in React."
+ );
+ a.depth === b.depth ? Bb(a, b) : Eb(a, b);
+}
+function Fb(a, b) {
+ var c = b.parent;
+ if (null === c)
+ throw Error(
+ "The depth must equal at least at zero before reaching the root. This is a bug in React."
+ );
+ a.depth === c.depth ? Bb(a, c) : Fb(a, c);
+ b.context._currentValue = b.value;
+}
+function Gb(a) {
+ var b = L;
+ b !== a &&
+ (null === b
+ ? Db(a)
+ : null === a
+ ? Cb(b)
+ : b.depth === a.depth
+ ? Bb(b, a)
+ : b.depth > a.depth
+ ? Eb(b, a)
+ : Fb(b, a),
+ (L = a));
+}
+var Hb = {
+ isMounted: function () {
+ return !1;
+ },
+ enqueueSetState: function (a, b) {
+ a = a._reactInternals;
+ null !== a.queue && a.queue.push(b);
+ },
+ enqueueReplaceState: function (a, b) {
+ a = a._reactInternals;
+ a.replace = !0;
+ a.queue = [b];
+ },
+ enqueueForceUpdate: function () {},
+};
+function Ib(a, b, c, d) {
+ var e = void 0 !== a.state ? a.state : null;
+ a.updater = Hb;
+ a.props = c;
+ a.state = e;
+ var f = { queue: [], replace: !1 };
+ a._reactInternals = f;
+ var g = b.contextType;
+ a.context = "object" === typeof g && null !== g ? g._currentValue : d;
+ g = b.getDerivedStateFromProps;
+ "function" === typeof g &&
+ ((g = g(c, e)),
+ (e = null === g || void 0 === g ? e : x({}, e, g)),
+ (a.state = e));
+ if (
+ "function" !== typeof b.getDerivedStateFromProps &&
+ "function" !== typeof a.getSnapshotBeforeUpdate &&
+ ("function" === typeof a.UNSAFE_componentWillMount ||
+ "function" === typeof a.componentWillMount)
+ )
+ if (
+ ((b = a.state),
+ "function" === typeof a.componentWillMount && a.componentWillMount(),
+ "function" === typeof a.UNSAFE_componentWillMount &&
+ a.UNSAFE_componentWillMount(),
+ b !== a.state && Hb.enqueueReplaceState(a, a.state, null),
+ null !== f.queue && 0 < f.queue.length)
+ )
+ if (
+ ((b = f.queue),
+ (g = f.replace),
+ (f.queue = null),
+ (f.replace = !1),
+ g && 1 === b.length)
+ )
+ a.state = b[0];
+ else {
+ f = g ? b[0] : a.state;
+ e = !0;
+ for (g = g ? 1 : 0; g < b.length; g++) {
+ var h = b[g];
+ h = "function" === typeof h ? h.call(a, f, c, d) : h;
+ null != h && (e ? ((e = !1), (f = x({}, f, h))) : x(f, h));
+ }
+ a.state = f;
+ }
+ else f.queue = null;
+}
+var Jb = { id: 1, overflow: "" };
+function Kb(a, b, c) {
+ var d = a.id;
+ a = a.overflow;
+ var e = 32 - Lb(d) - 1;
+ d &= ~(1 << e);
+ c += 1;
+ var f = 32 - Lb(b) + e;
+ if (30 < f) {
+ var g = e - (e % 5);
+ f = (d & ((1 << g) - 1)).toString(32);
+ d >>= g;
+ e -= g;
+ return { id: (1 << (32 - Lb(b) + e)) | (c << e) | d, overflow: f + a };
+ }
+ return { id: (1 << f) | (c << e) | d, overflow: a };
+}
+var Lb = Math.clz32 ? Math.clz32 : Mb,
+ Nb = Math.log,
+ Ob = Math.LN2;
+function Mb(a) {
+ a >>>= 0;
+ return 0 === a ? 32 : (31 - ((Nb(a) / Ob) | 0)) | 0;
+}
+var Pb = Error(
+ "Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"
+);
+function Qb() {}
+function Rb(a, b, c) {
+ c = a[c];
+ void 0 === c ? a.push(b) : c !== b && (b.then(Qb, Qb), (b = c));
+ switch (b.status) {
+ case "fulfilled":
+ return b.value;
+ case "rejected":
+ throw b.reason;
+ default:
+ if ("string" !== typeof b.status)
+ switch (
+ ((a = b),
+ (a.status = "pending"),
+ a.then(
+ function (a) {
+ if ("pending" === b.status) {
+ var c = b;
+ c.status = "fulfilled";
+ c.value = a;
+ }
+ },
+ function (a) {
+ if ("pending" === b.status) {
+ var c = b;
+ c.status = "rejected";
+ c.reason = a;
+ }
+ }
+ ),
+ b.status)
+ ) {
+ case "fulfilled":
+ return b.value;
+ case "rejected":
+ throw b.reason;
+ }
+ Sb = b;
+ throw Pb;
+ }
+}
+var Sb = null;
+function Tb() {
+ if (null === Sb)
+ throw Error(
+ "Expected a suspended thenable. This is a bug in React. Please file an issue."
+ );
+ var a = Sb;
+ Sb = null;
+ return a;
+}
+function Ub(a, b) {
+ return (a === b && (0 !== a || 1 / a === 1 / b)) || (a !== a && b !== b);
+}
+var Vb = "function" === typeof Object.is ? Object.is : Ub,
+ M = null,
+ Wb = null,
+ Xb = null,
+ N = null,
+ O = !1,
+ Yb = !1,
+ Q = 0,
+ R = 0,
+ S = null,
+ T = null,
+ Zb = 0;
+function U() {
+ if (null === M)
+ 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."
+ );
+ return M;
+}
+function $b() {
+ if (0 < Zb)
+ throw Error("Rendered more hooks than during the previous render");
+ return { memoizedState: null, queue: null, next: null };
+}
+function ac() {
+ null === N
+ ? null === Xb
+ ? ((O = !1), (Xb = N = $b()))
+ : ((O = !0), (N = Xb))
+ : null === N.next
+ ? ((O = !1), (N = N.next = $b()))
+ : ((O = !0), (N = N.next));
+ return N;
+}
+function bc(a, b, c, d) {
+ for (; Yb; ) (Yb = !1), (R = Q = 0), (Zb += 1), (N = null), (c = a(b, d));
+ cc();
+ return c;
+}
+function dc() {
+ var a = S;
+ S = null;
+ return a;
+}
+function cc() {
+ Wb = M = null;
+ Yb = !1;
+ Xb = null;
+ Zb = 0;
+ N = T = null;
+}
+function ec(a, b) {
+ return "function" === typeof b ? b(a) : b;
+}
+function fc(a, b, c) {
+ M = U();
+ N = ac();
+ if (O) {
+ var d = N.queue;
+ b = d.dispatch;
+ if (null !== T && ((c = T.get(d)), void 0 !== c)) {
+ T.delete(d);
+ d = N.memoizedState;
+ do (d = a(d, c.action)), (c = c.next);
+ while (null !== c);
+ N.memoizedState = d;
+ return [d, b];
+ }
+ return [N.memoizedState, b];
+ }
+ a = a === ec ? ("function" === typeof b ? b() : b) : void 0 !== c ? c(b) : b;
+ N.memoizedState = a;
+ a = N.queue = { last: null, dispatch: null };
+ a = a.dispatch = gc.bind(null, M, a);
+ return [N.memoizedState, a];
+}
+function hc(a, b) {
+ M = U();
+ N = ac();
+ b = void 0 === b ? null : b;
+ if (null !== N) {
+ var c = N.memoizedState;
+ if (null !== c && null !== b) {
+ var d = c[1];
+ a: if (null === d) d = !1;
+ else {
+ for (var e = 0; e < d.length && e < b.length; e++)
+ if (!Vb(b[e], d[e])) {
+ d = !1;
+ break a;
+ }
+ d = !0;
+ }
+ if (d) return c[0];
+ }
+ }
+ a = a();
+ N.memoizedState = [a, b];
+ return a;
+}
+function gc(a, b, c) {
+ if (25 <= Zb)
+ throw Error(
+ "Too many re-renders. React limits the number of renders to prevent an infinite loop."
+ );
+ if (a === M)
+ if (
+ ((Yb = !0),
+ (a = { action: c, next: null }),
+ null === T && (T = new Map()),
+ (c = T.get(b)),
+ void 0 === c)
+ )
+ T.set(b, a);
+ else {
+ for (b = c; null !== b.next; ) b = b.next;
+ b.next = a;
+ }
+}
+function ic() {
+ throw Error(
+ "A function wrapped in useEvent can't be called during rendering."
+ );
+}
+function jc() {
+ throw Error("startTransition cannot be called during server rendering.");
+}
+function kc() {
+ throw Error("Cache cannot be refreshed during server rendering.");
+}
+function lc() {}
+var nc = {
+ readContext: function (a) {
+ return a._currentValue;
+ },
+ useContext: function (a) {
+ U();
+ return a._currentValue;
+ },
+ useMemo: hc,
+ useReducer: fc,
+ useRef: function (a) {
+ M = U();
+ N = ac();
+ var b = N.memoizedState;
+ return null === b ? ((a = { current: a }), (N.memoizedState = a)) : b;
+ },
+ useState: function (a) {
+ return fc(ec, a);
+ },
+ useInsertionEffect: lc,
+ useLayoutEffect: function () {},
+ useCallback: function (a, b) {
+ return hc(function () {
+ return a;
+ }, b);
+ },
+ useImperativeHandle: lc,
+ useEffect: lc,
+ useDebugValue: lc,
+ useDeferredValue: function (a) {
+ U();
+ return a;
+ },
+ useTransition: function () {
+ U();
+ return [!1, jc];
+ },
+ useId: function () {
+ var a = Wb.treeContext;
+ var b = a.overflow;
+ a = a.id;
+ a = (a & ~(1 << (32 - Lb(a) - 1))).toString(32) + b;
+ var c = mc;
+ if (null === c)
+ throw Error(
+ "Invalid hook call. Hooks can only be called inside of the body of a function component."
+ );
+ b = Q++;
+ a = ":" + c.idPrefix + "R" + a;
+ 0 < b && (a += "H" + b.toString(32));
+ return a + ":";
+ },
+ useMutableSource: function (a, b) {
+ U();
+ return b(a._source);
+ },
+ useSyncExternalStore: function (a, b, c) {
+ if (void 0 === c)
+ throw Error(
+ "Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering."
+ );
+ return c();
+ },
+ useCacheRefresh: function () {
+ return kc;
+ },
+ useEvent: function () {
+ return ic;
+ },
+ useMemoCache: function (a) {
+ for (var b = Array(a), c = 0; c < a; c++) b[c] = vb;
+ return b;
+ },
+ use: function (a) {
+ if (null !== a && "object" === typeof a) {
+ if ("function" === typeof a.then) {
+ var b = R;
+ R += 1;
+ null === S && (S = []);
+ return Rb(S, a, b);
+ }
+ if (a.$$typeof === ib || a.$$typeof === jb) return a._currentValue;
+ }
+ throw Error("An unsupported type was passed to use(): " + String(a));
+ },
+ },
+ mc = null,
+ oc = {
+ getCacheSignal: function () {
+ throw Error("Not implemented.");
+ },
+ getCacheForType: function () {
+ throw Error("Not implemented.");
+ },
+ },
+ pc = yb.ReactCurrentDispatcher,
+ qc = yb.ReactCurrentCache;
+function rc(a) {
+ console.error(a);
+ return null;
+}
+function W() {}
+function sc(a, b, c, d, e, f, g, h, m) {
+ var k = [],
+ p = new Set(),
+ n = {
+ preloadsMap: new Map(),
+ stylesMap: new Map(),
+ scriptsMap: new Map(),
+ headsMap: new Map(),
+ charset: null,
+ bases: new Set(),
+ preconnects: new Set(),
+ fontPreloads: new Set(),
+ precedences: new Map(),
+ usedStylePreloads: new Set(),
+ scripts: new Set(),
+ usedScriptPreloads: new Set(),
+ explicitStylePreloads: new Set(),
+ explicitScriptPreloads: new Set(),
+ headResources: new Set(),
+ structuredMetaKeys: new Map(),
+ boundaryResources: null,
+ };
+ b = {
+ destination: null,
+ responseState: b,
+ progressiveChunkSize: void 0 === d ? 12800 : d,
+ status: 0,
+ fatalError: null,
+ nextSegmentId: 0,
+ allPendingTasks: 0,
+ pendingRootTasks: 0,
+ resources: n,
+ completedRootSegment: null,
+ abortableTasks: p,
+ pingedTasks: k,
+ clientRenderedBoundaries: [],
+ completedBoundaries: [],
+ partialBoundaries: [],
+ preamble: [],
+ postamble: [],
+ onError: void 0 === e ? rc : e,
+ onAllReady: void 0 === f ? W : f,
+ onShellReady: void 0 === g ? W : g,
+ onShellError: void 0 === h ? W : h,
+ onFatalError: void 0 === m ? W : m,
+ };
+ c = tc(b, 0, null, c, !1, !1);
+ c.parentFlushed = !0;
+ a = uc(b, null, a, null, c, p, zb, null, Jb);
+ k.push(a);
+ return b;
+}
+function uc(a, b, c, d, e, f, g, h, m) {
+ a.allPendingTasks++;
+ null === d ? a.pendingRootTasks++ : d.pendingTasks++;
+ var k = {
+ node: c,
+ ping: function () {
+ var b = a.pingedTasks;
+ b.push(k);
+ 1 === b.length && vc(a);
+ },
+ blockedBoundary: d,
+ blockedSegment: e,
+ abortSet: f,
+ legacyContext: g,
+ context: h,
+ treeContext: m,
+ thenableState: b,
+ };
+ f.add(k);
+ return k;
+}
+function tc(a, b, c, d, e, f) {
+ return {
+ status: 0,
+ id: -1,
+ index: b,
+ parentFlushed: !1,
+ chunks: [],
+ children: [],
+ formatContext: d,
+ boundary: c,
+ lastPushedText: e,
+ textEmbedded: f,
+ };
+}
+function X(a, b) {
+ a = a.onError(b);
+ if (null != a && "string" !== typeof a)
+ throw Error(
+ 'onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "' +
+ typeof a +
+ '" instead'
+ );
+ return a;
+}
+function Y(a, b) {
+ var c = a.onShellError;
+ c(b);
+ c = a.onFatalError;
+ c(b);
+ null !== a.destination
+ ? ((a.status = 2), da(a.destination, b))
+ : ((a.status = 1), (a.fatalError = b));
+}
+function wc(a, b, c, d) {
+ var e = c.render(),
+ f = d.childContextTypes;
+ if (null !== f && void 0 !== f) {
+ var g = b.legacyContext;
+ if ("function" !== typeof c.getChildContext) d = g;
+ else {
+ c = c.getChildContext();
+ for (var h in c)
+ if (!(h in f))
+ throw Error(
+ (xb(d) || "Unknown") +
+ '.getChildContext(): key "' +
+ h +
+ '" is not defined in childContextTypes.'
+ );
+ d = x({}, g, c);
+ }
+ b.legacyContext = d;
+ Z(a, b, null, e);
+ b.legacyContext = g;
+ } else Z(a, b, null, e);
+}
+function xc(a, b) {
+ if (a && a.defaultProps) {
+ b = x({}, b);
+ a = a.defaultProps;
+ for (var c in a) void 0 === b[c] && (b[c] = a[c]);
+ return b;
+ }
+ return b;
+}
+function yc(a, b, c, d, e, f) {
+ if ("function" === typeof d)
+ if (d.prototype && d.prototype.isReactComponent)
+ (c = Ab(d, b.legacyContext)),
+ (f = d.contextType),
+ (f = new d(
+ e,
+ "object" === typeof f && null !== f ? f._currentValue : c
+ )),
+ Ib(f, d, e, c),
+ wc(a, b, f, d);
+ else {
+ f = Ab(d, b.legacyContext);
+ M = {};
+ Wb = b;
+ R = Q = 0;
+ S = c;
+ c = d(e, f);
+ c = bc(d, e, c, f);
+ var g = 0 !== Q;
+ if (
+ "object" === typeof c &&
+ null !== c &&
+ "function" === typeof c.render &&
+ void 0 === c.$$typeof
+ )
+ Ib(c, d, e, f), wc(a, b, c, d);
+ else if (g) {
+ e = b.treeContext;
+ b.treeContext = Kb(e, 1, 0);
+ try {
+ Z(a, b, null, c);
+ } finally {
+ b.treeContext = e;
+ }
+ } else Z(a, b, null, c);
+ }
+ else if ("string" === typeof d)
+ (c = b.blockedSegment),
+ (f = Sa(
+ c.chunks,
+ a.preamble,
+ d,
+ e,
+ a.responseState,
+ c.formatContext,
+ c.lastPushedText
+ )),
+ (c.lastPushedText = !1),
+ (g = c.formatContext),
+ (c.formatContext = Ja(g, d, e)),
+ zc(a, b, f),
+ (c.formatContext = g),
+ Ta(c.chunks, a.postamble, d),
+ (c.lastPushedText = !1);
+ else {
+ switch (d) {
+ case sb:
+ case qb:
+ case fb:
+ case gb:
+ case eb:
+ Z(a, b, null, e.children);
+ return;
+ case rb:
+ "hidden" !== e.mode && Z(a, b, null, e.children);
+ return;
+ case mb:
+ Z(a, b, null, e.children);
+ return;
+ case pb:
+ throw Error("ReactDOMServer does not yet support scope components.");
+ case lb:
+ a: {
+ d = b.blockedBoundary;
+ c = b.blockedSegment;
+ f = e.fallback;
+ e = e.children;
+ g = new Set();
+ var h = {
+ id: null,
+ rootSegmentID: -1,
+ parentFlushed: !1,
+ pendingTasks: 0,
+ forceClientRender: !1,
+ completedSegments: [],
+ byteSize: 0,
+ fallbackAbortableTasks: g,
+ errorDigest: null,
+ resources: new Set(),
+ },
+ m = tc(a, c.chunks.length, h, c.formatContext, !1, !1);
+ c.children.push(m);
+ c.lastPushedText = !1;
+ var k = tc(a, 0, null, c.formatContext, !1, !1);
+ k.parentFlushed = !0;
+ b.blockedBoundary = h;
+ b.blockedSegment = k;
+ a.resources.boundaryResources = h.resources;
+ try {
+ if (
+ (zc(a, b, e),
+ k.lastPushedText &&
+ k.textEmbedded &&
+ k.chunks.push("\x3c!-- --\x3e"),
+ (k.status = 1),
+ 0 === h.pendingTasks &&
+ (null !== a.completedRootSegment || 0 < a.pendingRootTasks) &&
+ Da(a.resources, h.resources),
+ Ac(h, k),
+ 0 === h.pendingTasks)
+ )
+ break a;
+ } catch (p) {
+ (k.status = 4),
+ (h.forceClientRender = !0),
+ (h.errorDigest = X(a, p));
+ } finally {
+ (a.resources.boundaryResources = d ? d.resources : null),
+ (b.blockedBoundary = d),
+ (b.blockedSegment = c);
+ }
+ b = uc(
+ a,
+ null,
+ f,
+ d,
+ m,
+ g,
+ b.legacyContext,
+ b.context,
+ b.treeContext
+ );
+ a.pingedTasks.push(b);
+ }
+ return;
+ }
+ if ("object" === typeof d && null !== d)
+ switch (d.$$typeof) {
+ case kb:
+ d = d.render;
+ M = {};
+ Wb = b;
+ R = Q = 0;
+ S = c;
+ c = d(e, f);
+ e = bc(d, e, c, f);
+ if (0 !== Q) {
+ d = b.treeContext;
+ b.treeContext = Kb(d, 1, 0);
+ try {
+ Z(a, b, null, e);
+ } finally {
+ b.treeContext = d;
+ }
+ } else Z(a, b, null, e);
+ return;
+ case nb:
+ d = d.type;
+ e = xc(d, e);
+ yc(a, b, c, d, e, f);
+ return;
+ case hb:
+ c = e.children;
+ d = d._context;
+ e = e.value;
+ f = d._currentValue;
+ d._currentValue = e;
+ g = L;
+ L = e = {
+ parent: g,
+ depth: null === g ? 0 : g.depth + 1,
+ context: d,
+ parentValue: f,
+ value: e,
+ };
+ b.context = e;
+ Z(a, b, null, c);
+ a = L;
+ if (null === a)
+ throw Error(
+ "Tried to pop a Context at the root of the app. This is a bug in React."
+ );
+ e = a.parentValue;
+ a.context._currentValue = e === ub ? a.context._defaultValue : e;
+ a = L = a.parent;
+ b.context = a;
+ return;
+ case ib:
+ e = e.children;
+ e = e(d._currentValue);
+ Z(a, b, null, e);
+ return;
+ case ob:
+ f = d._init;
+ d = f(d._payload);
+ e = xc(d, e);
+ yc(a, b, c, d, e, void 0);
+ return;
+ }
+ throw Error(
+ "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " +
+ ((null == d ? d : typeof d) + ".")
+ );
+ }
+}
+function Z(a, b, c, d) {
+ b.node = d;
+ if ("object" === typeof d && null !== d) {
+ switch (d.$$typeof) {
+ case cb:
+ yc(a, b, c, d.type, d.props, d.ref);
+ return;
+ case db:
+ throw Error(
+ "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render."
+ );
+ case ob:
+ c = d._init;
+ d = c(d._payload);
+ Z(a, b, null, d);
+ return;
+ }
+ if (ra(d)) {
+ Bc(a, b, d);
+ return;
+ }
+ null === d || "object" !== typeof d
+ ? (c = null)
+ : ((c = (wb && d[wb]) || d["@@iterator"]),
+ (c = "function" === typeof c ? c : null));
+ if (c && (c = c.call(d))) {
+ d = c.next();
+ if (!d.done) {
+ var e = [];
+ do e.push(d.value), (d = c.next());
+ while (!d.done);
+ Bc(a, b, e);
+ }
+ return;
+ }
+ a = Object.prototype.toString.call(d);
+ throw Error(
+ "Objects are not valid as a React child (found: " +
+ ("[object Object]" === a
+ ? "object with keys {" + Object.keys(d).join(", ") + "}"
+ : a) +
+ "). If you meant to render a collection of children, use an array instead."
+ );
+ }
+ "string" === typeof d
+ ? ((c = b.blockedSegment),
+ (c.lastPushedText = Ka(
+ b.blockedSegment.chunks,
+ d,
+ a.responseState,
+ c.lastPushedText
+ )))
+ : "number" === typeof d &&
+ ((c = b.blockedSegment),
+ (c.lastPushedText = Ka(
+ b.blockedSegment.chunks,
+ "" + d,
+ a.responseState,
+ c.lastPushedText
+ )));
+}
+function Bc(a, b, c) {
+ for (var d = c.length, e = 0; e < d; e++) {
+ var f = b.treeContext;
+ b.treeContext = Kb(f, d, e);
+ try {
+ zc(a, b, c[e]);
+ } finally {
+ b.treeContext = f;
+ }
+ }
+}
+function zc(a, b, c) {
+ var d = b.blockedSegment.formatContext,
+ e = b.legacyContext,
+ f = b.context;
+ try {
+ return Z(a, b, null, c);
+ } catch (k) {
+ if (
+ (cc(),
+ (c = k === Pb ? Tb() : k),
+ "object" === typeof c && null !== c && "function" === typeof c.then)
+ ) {
+ var g = dc(),
+ h = b.blockedSegment,
+ m = tc(a, h.chunks.length, null, h.formatContext, h.lastPushedText, !0);
+ h.children.push(m);
+ h.lastPushedText = !1;
+ a = uc(
+ a,
+ g,
+ b.node,
+ b.blockedBoundary,
+ m,
+ b.abortSet,
+ b.legacyContext,
+ b.context,
+ b.treeContext
+ ).ping;
+ c.then(a, a);
+ b.blockedSegment.formatContext = d;
+ b.legacyContext = e;
+ b.context = f;
+ Gb(f);
+ } else
+ throw (
+ ((b.blockedSegment.formatContext = d),
+ (b.legacyContext = e),
+ (b.context = f),
+ Gb(f),
+ c)
+ );
+ }
+}
+function Cc(a) {
+ var b = a.blockedBoundary;
+ a = a.blockedSegment;
+ a.status = 3;
+ Dc(this, b, a);
+}
+function Ec(a, b, c) {
+ var d = a.blockedBoundary;
+ a.blockedSegment.status = 3;
+ null === d
+ ? (b.allPendingTasks--,
+ 1 !== b.status && 2 !== b.status && (X(b, c), Y(b, c)))
+ : (d.pendingTasks--,
+ d.forceClientRender ||
+ ((d.forceClientRender = !0),
+ (d.errorDigest = b.onError(c)),
+ d.parentFlushed && b.clientRenderedBoundaries.push(d)),
+ d.fallbackAbortableTasks.forEach(function (a) {
+ return Ec(a, b, c);
+ }),
+ d.fallbackAbortableTasks.clear(),
+ b.allPendingTasks--,
+ 0 === b.allPendingTasks && ((a = b.onAllReady), a()));
+}
+function Ac(a, b) {
+ if (
+ 0 === b.chunks.length &&
+ 1 === b.children.length &&
+ null === b.children[0].boundary
+ ) {
+ var c = b.children[0];
+ c.id = b.id;
+ c.parentFlushed = !0;
+ 1 === c.status && Ac(a, c);
+ } else a.completedSegments.push(b);
+}
+function Dc(a, b, c) {
+ if (null === b) {
+ if (c.parentFlushed) {
+ if (null !== a.completedRootSegment)
+ throw Error(
+ "There can only be one root segment. This is a bug in React."
+ );
+ a.completedRootSegment = c;
+ }
+ a.pendingRootTasks--;
+ 0 === a.pendingRootTasks &&
+ ((a.onShellError = W), (b = a.onShellReady), b());
+ } else
+ b.pendingTasks--,
+ b.forceClientRender ||
+ (0 === b.pendingTasks
+ ? (c.parentFlushed && 1 === c.status && Ac(b, c),
+ (null !== a.completedRootSegment || 0 < a.pendingRootTasks) &&
+ Da(a.resources, b.resources),
+ b.parentFlushed && a.completedBoundaries.push(b),
+ b.fallbackAbortableTasks.forEach(Cc, a),
+ b.fallbackAbortableTasks.clear())
+ : c.parentFlushed &&
+ 1 === c.status &&
+ (Ac(b, c),
+ 1 === b.completedSegments.length &&
+ b.parentFlushed &&
+ a.partialBoundaries.push(b)));
+ a.allPendingTasks--;
+ 0 === a.allPendingTasks && ((a = a.onAllReady), a());
+}
+function vc(a) {
+ if (2 !== a.status) {
+ var b = L,
+ c = pc.current;
+ pc.current = nc;
+ var d = qc.current;
+ qc.current = oc;
+ var e = a.resources;
+ sa.push(y);
+ y = e;
+ e = Ea.current;
+ Ea.current = va;
+ var f = mc;
+ mc = a.responseState;
+ try {
+ var g = a.pingedTasks,
+ h;
+ for (h = 0; h < g.length; h++) {
+ var m = g[h];
+ var k = a,
+ p = m.blockedBoundary;
+ k.resources.boundaryResources = p ? p.resources : null;
+ var n = m.blockedSegment;
+ if (0 === n.status) {
+ Gb(m.context);
+ try {
+ var q = m.thenableState;
+ m.thenableState = null;
+ Z(k, m, q, m.node);
+ n.lastPushedText &&
+ n.textEmbedded &&
+ n.chunks.push("\x3c!-- --\x3e");
+ m.abortSet.delete(m);
+ n.status = 1;
+ Dc(k, m.blockedBoundary, n);
+ } catch (aa) {
+ cc();
+ var u = aa === Pb ? Tb() : aa;
+ if (
+ "object" === typeof u &&
+ null !== u &&
+ "function" === typeof u.then
+ ) {
+ var H = m.ping;
+ u.then(H, H);
+ m.thenableState = dc();
+ } else {
+ m.abortSet.delete(m);
+ n.status = 4;
+ var B = k,
+ E = m.blockedBoundary,
+ V = u,
+ P = X(B, V);
+ null === E
+ ? Y(B, V)
+ : (E.pendingTasks--,
+ E.forceClientRender ||
+ ((E.forceClientRender = !0),
+ (E.errorDigest = P),
+ E.parentFlushed && B.clientRenderedBoundaries.push(E)));
+ B.allPendingTasks--;
+ if (0 === B.allPendingTasks) {
+ var Mc = B.onAllReady;
+ Mc();
+ }
+ }
+ } finally {
+ k.resources.boundaryResources = null;
+ }
+ }
+ }
+ g.splice(0, h);
+ null !== a.destination && Fc(a, a.destination);
+ } catch (aa) {
+ X(a, aa), Y(a, aa);
+ } finally {
+ (mc = f),
+ (pc.current = c),
+ (qc.current = d),
+ (y = sa.pop()),
+ (Ea.current = e),
+ c === nc && Gb(b);
+ }
+ }
+}
+function Gc(a, b, c) {
+ c.parentFlushed = !0;
+ switch (c.status) {
+ case 0:
+ var d = (c.id = a.nextSegmentId++);
+ c.lastPushedText = !1;
+ c.textEmbedded = !1;
+ a = a.responseState;
+ l(b, '<template id="');
+ l(b, a.placeholderPrefix);
+ a = d.toString(16);
+ l(b, a);
+ return !!b.write('"></template>');
+ case 1:
+ c.status = 2;
+ var e = !0;
+ d = c.chunks;
+ var f = 0;
+ c = c.children;
+ for (var g = 0; g < c.length; g++) {
+ for (e = c[g]; f < e.index; f++) l(b, d[f]);
+ e = Hc(a, b, e);
+ }
+ for (; f < d.length - 1; f++) l(b, d[f]);
+ f < d.length && (e = !!b.write(d[f]));
+ return e;
+ default:
+ throw Error(
+ "Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React."
+ );
+ }
+}
+function Hc(a, b, c) {
+ var d = c.boundary;
+ if (null === d) return Gc(a, b, c);
+ d.parentFlushed = !0;
+ if (d.forceClientRender)
+ (d = d.errorDigest),
+ b.write("\x3c!--$!--\x3e"),
+ l(b, "<template"),
+ d && (l(b, ' data-dgst="'), l(b, w(d)), l(b, '"')),
+ b.write("></template>"),
+ Gc(a, b, c);
+ else if (0 < d.pendingTasks) {
+ d.rootSegmentID = a.nextSegmentId++;
+ 0 < d.completedSegments.length && a.partialBoundaries.push(d);
+ var e = a.responseState;
+ var f = e.nextSuspenseID++;
+ e = e.boundaryPrefix + f.toString(16);
+ d = d.id = e;
+ Ua(b, a.responseState, d);
+ Gc(a, b, c);
+ } else if (d.byteSize > a.progressiveChunkSize)
+ (d.rootSegmentID = a.nextSegmentId++),
+ a.completedBoundaries.push(d),
+ Ua(b, a.responseState, d.id),
+ Gc(a, b, c);
+ else {
+ Ca(a.resources, d.resources);
+ b.write("\x3c!--$--\x3e");
+ c = d.completedSegments;
+ if (1 !== c.length)
+ throw Error(
+ "A previously unvisited boundary must have exactly one root segment. This is a bug in React."
+ );
+ Hc(a, b, c[0]);
+ }
+ return !!b.write("\x3c!--/$--\x3e");
+}
+function Ic(a, b, c) {
+ Va(b, a.responseState, c.formatContext, c.id);
+ Hc(a, b, c);
+ return Wa(b, c.formatContext);
+}
+function Jc(a, b, c) {
+ a.resources.boundaryResources = c.resources;
+ for (var d = c.completedSegments, e = 0; e < d.length; e++) Kc(a, b, c, d[e]);
+ d.length = 0;
+ a = a.responseState;
+ d = c.id;
+ e = c.rootSegmentID;
+ c = c.resources;
+ var f;
+ a: {
+ for (f = c.values(); ; ) {
+ var g = f.next().value;
+ if (!g) break;
+ if (!g.inShell) {
+ f = !0;
+ break a;
+ }
+ }
+ f = !1;
+ }
+ l(b, a.startInlineScript);
+ f
+ ? a.sentCompleteBoundaryFunction
+ ? a.sentStyleInsertionFunction
+ ? l(b, '$RR("')
+ : ((a.sentStyleInsertionFunction = !0),
+ l(
+ b,
+ '$RM=new Map;\n$RR=function(p,q,v){function r(l){this.s=l}for(var t=$RC,u=$RM,m=new Map,n=document,g,e,f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;e=f[d++];)m.set(e.dataset.precedence,g=e);e=0;f=[];for(var c,h,b,a;c=v[e++];){var k=0;h=c[k++];if(b=u.get(h))"l"!==b.s&&f.push(b);else{a=n.createElement("link");a.href=h;a.rel="stylesheet";for(a.dataset.precedence=d=c[k++];b=c[k++];)a.setAttribute(b,c[k++]);b=a._p=new Promise(function(l,w){a.onload=l;a.onerror=w});b.then(r.bind(b,\n"l"),r.bind(b,"e"));u.set(h,b);f.push(b);c=m.get(d)||g;c===g&&(g=a);m.set(d,a);c?c.parentNode.insertBefore(a,c.nextSibling):(d=n.head,d.insertBefore(a,d.firstChild))}}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};;$RR("'
+ ))
+ : ((a.sentCompleteBoundaryFunction = !0),
+ (a.sentStyleInsertionFunction = !0),
+ l(
+ b,
+ '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};;$RM=new Map;\n$RR=function(p,q,v){function r(l){this.s=l}for(var t=$RC,u=$RM,m=new Map,n=document,g,e,f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;e=f[d++];)m.set(e.dataset.precedence,g=e);e=0;f=[];for(var c,h,b,a;c=v[e++];){var k=0;h=c[k++];if(b=u.get(h))"l"!==b.s&&f.push(b);else{a=n.createElement("link");a.href=h;a.rel="stylesheet";for(a.dataset.precedence=d=c[k++];b=c[k++];)a.setAttribute(b,c[k++]);b=a._p=new Promise(function(l,w){a.onload=l;a.onerror=w});b.then(r.bind(b,\n"l"),r.bind(b,"e"));u.set(h,b);f.push(b);c=m.get(d)||g;c===g&&(g=a);m.set(d,a);c?c.parentNode.insertBefore(a,c.nextSibling):(d=n.head,d.insertBefore(a,d.firstChild))}}Promise.all(f).then(t.bind(null,p,q,""),t.bind(null,p,q,"Resource failed to load"))};;$RR("'
+ ))
+ : a.sentCompleteBoundaryFunction
+ ? l(b, '$RC("')
+ : ((a.sentCompleteBoundaryFunction = !0),
+ l(
+ b,
+ '$RC=function(b,c,e){c=document.getElementById(c);c.parentNode.removeChild(c);var a=document.getElementById(b);if(a){b=a.previousSibling;if(e)b.data="$!",a.setAttribute("data-dgst",e);else{e=b.parentNode;a=b.nextSibling;var f=0;do{if(a&&8===a.nodeType){var d=a.data;if("/$"===d)if(0===f)break;else f--;else"$"!==d&&"$?"!==d&&"$!"!==d||f++}d=a.nextSibling;e.removeChild(a);a=d}while(a);for(;c.firstChild;)e.insertBefore(c.firstChild,a);b.data="$"}b._reactRetry&&b._reactRetry()}};;$RC("'
+ ));
+ if (null === d)
+ throw Error(
+ "An ID must have been assigned before we can complete the boundary."
+ );
+ e = e.toString(16);
+ l(b, d);
+ l(b, '","');
+ l(b, a.segmentPrefix);
+ l(b, e);
+ f ? (l(b, '",'), bb(b, c)) : l(b, '"');
+ return !!b.write(")\x3c/script>");
+}
+function Kc(a, b, c, d) {
+ if (2 === d.status) return !0;
+ var e = d.id;
+ if (-1 === e) {
+ if (-1 === (d.id = c.rootSegmentID))
+ throw Error(
+ "A root segment ID must have been assigned by now. This is a bug in React."
+ );
+ return Ic(a, b, d);
+ }
+ Ic(a, b, d);
+ a = a.responseState;
+ l(b, a.startInlineScript);
+ a.sentCompleteSegmentFunction
+ ? l(b, '$RS("')
+ : ((a.sentCompleteSegmentFunction = !0),
+ l(
+ b,
+ '$RS=function(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};;$RS("'
+ ));
+ l(b, a.segmentPrefix);
+ e = e.toString(16);
+ l(b, e);
+ l(b, '","');
+ l(b, a.placeholderPrefix);
+ l(b, e);
+ return !!b.write('")\x3c/script>');
+}
+function Fc(a, b) {
+ try {
+ var c,
+ d = a.completedRootSegment;
+ if (null !== d)
+ if (0 === a.pendingRootTasks) {
+ var e = a.preamble;
+ for (c = 0; c < e.length; c++) l(b, e[c]);
+ $a(b, a.resources, a.responseState);
+ Hc(a, b, d);
+ a.completedRootSegment = null;
+ var f = a.responseState.bootstrapChunks;
+ for (d = 0; d < f.length - 1; d++) l(b, f[d]);
+ d < f.length && b.write(f[d]);
+ } else return;
+ else ab(b, a.resources, a.responseState);
+ var g = a.clientRenderedBoundaries;
+ for (c = 0; c < g.length; c++) {
+ var h = g[c];
+ f = b;
+ var m = a.responseState,
+ k = h.id,
+ p = h.errorDigest,
+ n = h.errorMessage,
+ q = h.errorComponentStack;
+ l(f, m.startInlineScript);
+ m.sentClientRenderFunction
+ ? l(f, '$RX("')
+ : ((m.sentClientRenderFunction = !0),
+ l(
+ f,
+ '$RX=function(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};;$RX("'
+ ));
+ if (null === k)
+ throw Error(
+ "An ID must have been assigned before we can complete the boundary."
+ );
+ l(f, k);
+ l(f, '"');
+ if (p || n || q) l(f, ","), l(f, Ya(p || ""));
+ if (n || q) l(f, ","), l(f, Ya(n || ""));
+ q && (l(f, ","), l(f, Ya(q)));
+ if (!f.write(")\x3c/script>")) {
+ a.destination = null;
+ c++;
+ g.splice(0, c);
+ return;
+ }
+ }
+ g.splice(0, c);
+ var u = a.completedBoundaries;
+ for (c = 0; c < u.length; c++)
+ if (!Jc(a, b, u[c])) {
+ a.destination = null;
+ c++;
+ u.splice(0, c);
+ return;
+ }
+ u.splice(0, c);
+ var H = a.partialBoundaries;
+ for (c = 0; c < H.length; c++) {
+ var B = H[c];
+ a: {
+ g = a;
+ h = b;
+ g.resources.boundaryResources = B.resources;
+ var E = B.completedSegments;
+ for (m = 0; m < E.length; m++)
+ if (!Kc(g, h, B, E[m])) {
+ m++;
+ E.splice(0, m);
+ var V = !1;
+ break a;
+ }
+ E.splice(0, m);
+ V = !0;
+ }
+ if (!V) {
+ a.destination = null;
+ c++;
+ H.splice(0, c);
+ return;
+ }
+ }
+ H.splice(0, c);
+ var P = a.completedBoundaries;
+ for (c = 0; c < P.length; c++)
+ if (!Jc(a, b, P[c])) {
+ a.destination = null;
+ c++;
+ P.splice(0, c);
+ return;
+ }
+ P.splice(0, c);
+ } finally {
+ if (
+ 0 === a.allPendingTasks &&
+ 0 === a.pingedTasks.length &&
+ 0 === a.clientRenderedBoundaries.length &&
+ 0 === a.completedBoundaries.length
+ ) {
+ a = a.postamble;
+ for (c = 0; c < a.length; c++) l(b, a[c]);
+ b.end();
+ }
+ }
+}
+function Lc(a, b) {
+ try {
+ var c = a.abortableTasks;
+ if (0 < c.size) {
+ var d =
+ void 0 === b
+ ? Error("The render was aborted by the server without a reason.")
+ : b;
+ c.forEach(function (b) {
+ return Ec(b, a, d);
+ });
+ c.clear();
+ }
+ null !== a.destination && Fc(a, a.destination);
+ } catch (e) {
+ X(a, e), Y(a, e);
+ }
+}
+exports.renderToNodeStream = function () {
+ throw Error(
+ "ReactDOMServer.renderToNodeStream(): The Node Stream API is not available in Bun. Use ReactDOMServer.renderToReadableStream() instead."
+ );
+};
+exports.renderToReadableStream = function (a, b) {
+ return new Promise(function (c, d) {
+ var e,
+ f,
+ g = new Promise(function (a, b) {
+ f = a;
+ e = b;
+ }),
+ h = sc(
+ a,
+ Ha(
+ b ? b.identifierPrefix : void 0,
+ b ? b.nonce : void 0,
+ b ? b.bootstrapScriptContent : void 0,
+ b ? b.bootstrapScripts : void 0,
+ b ? b.bootstrapModules : void 0,
+ b ? b.unstable_externalRuntimeSrc : void 0
+ ),
+ Ia(b ? b.namespaceURI : void 0),
+ b ? b.progressiveChunkSize : void 0,
+ b ? b.onError : void 0,
+ f,
+ function () {
+ var a = new ReadableStream(
+ {
+ type: "direct",
+ pull: function (a) {
+ if (1 === h.status) (h.status = 2), da(a, h.fatalError);
+ else if (2 !== h.status && null === h.destination) {
+ h.destination = a;
+ try {
+ Fc(h, a);
+ } catch (q) {
+ X(h, q), Y(h, q);
+ }
+ }
+ },
+ cancel: function () {
+ Lc(h);
+ },
+ },
+ { highWaterMark: 2048 }
+ );
+ a.allReady = g;
+ c(a);
+ },
+ function (a) {
+ g.catch(function () {});
+ d(a);
+ },
+ e
+ );
+ if (b && b.signal) {
+ var m = b.signal;
+ if (m.aborted) Lc(h, m.reason);
+ else {
+ var k = function () {
+ Lc(h, m.reason);
+ m.removeEventListener("abort", k);
+ };
+ m.addEventListener("abort", k);
+ }
+ }
+ vc(h);
+ });
+};
+exports.renderToStaticNodeStream = function () {
+ throw Error(
+ "ReactDOMServer.renderToStaticNodeStream(): The Node Stream API is not available in Bun. Use ReactDOMServer.renderToReadableStream() instead."
+ );
+};
+exports.version = "18.2.0";
diff --git a/test/bun.js/react-dom.test.tsx b/test/bun.js/react-dom.test.tsx
index 678f1ee9a..a05ed16a1 100644
--- a/test/bun.js/react-dom.test.tsx
+++ b/test/bun.js/react-dom.test.tsx
@@ -10,7 +10,7 @@ import { heapStats } from "bun:jsc";
import { describe, expect, it } from "bun:test";
import { renderToReadableStream as renderToReadableStreamBrowser } from "react-dom/server.browser";
import { gc } from "./gc";
-import { renderToReadableStream as renderToReadableStreamBun } from "./react-dom-server.bun";
+import { renderToReadableStream as renderToReadableStreamBun } from "./react-dom-server.bun.cjs";
import React from "react";
Object.defineProperty(renderToReadableStreamBrowser, "name", {
@@ -93,9 +93,11 @@ describe("React", () => {
it("React.createContext works", () => {
expect(typeof React.createContext).toBe("function");
const pleaseDontThrow = React.createContext({ foo: true });
- expect(pleaseDontThrow.$$typeof.description).toBe("react.context");
+ expect((pleaseDontThrow as any).$$typeof.description).toBe("react.context");
- const pleaseDontThrow2 = React.default.createContext({ foo: true });
+ const pleaseDontThrow2 = (React as any).default.createContext({
+ foo: true,
+ });
expect(pleaseDontThrow2.$$typeof.description).toBe("react.context");
});
});
@@ -117,7 +119,7 @@ describe("ReactDOM", () => {
gc();
expect(text.replaceAll("<!-- -->", "")).toBe(inputString);
gc();
- } catch (e) {
+ } catch (e: any) {
console.log(e.stack);
throw e;
}
@@ -159,7 +161,7 @@ describe("ReactDOM", () => {
gc();
expect(text.replaceAll("<!-- -->", "")).toBe(inputString);
gc();
- } catch (e) {
+ } catch (e: any) {
console.error(e.message);
console.error(e.stack);
throw e;
@@ -172,7 +174,7 @@ describe("ReactDOM", () => {
const text =
renderToReadableStream === renderToReadableStreamBun
? array.join("")
- : new TextDecoder().decode(concatArrayBuffers(array));
+ : new TextDecoder().decode(concatArrayBuffers(array as any[]));
gc();
expect(text.replaceAll("<!-- -->", "")).toBe(inputString);
gc();
@@ -189,7 +191,7 @@ describe("ReactDOM", () => {
it("for await (chunk of stream)", async () => {
const stream = await renderToReadableStream(reactElement);
gc();
- const chunks = [];
+ const chunks: any = [];
for await (let chunk of stream) {
chunks.push(chunk);
}
@@ -202,12 +204,12 @@ describe("ReactDOM", () => {
it("for await (chunk of stream) (arrayBuffer)", async () => {
const stream = await renderToReadableStream(reactElement);
gc();
- const chunks = [];
+ const chunks: any[] = [];
for await (let chunk of stream) {
chunks.push(chunk);
}
const text = new TextDecoder().decode(
- await new Response(chunks).arrayBuffer()
+ await new Response(chunks as any).arrayBuffer(),
);
gc();
expect(text.replaceAll("<!-- -->", "")).toBe(inputString);
diff --git a/test/bun.js/resolve-error.test.ts b/test/bun.js/resolve-error.test.ts
index 4db6319cc..cddd2c051 100644
--- a/test/bun.js/resolve-error.test.ts
+++ b/test/bun.js/resolve-error.test.ts
@@ -4,7 +4,7 @@ describe("ResolveError", () => {
it("position object does not segfault", async () => {
try {
await import("./file-importing-nonexistent-file.js");
- } catch (e) {
+ } catch (e: any) {
expect(Bun.inspect(e.position).length > 0).toBe(true);
}
});
diff --git a/test/bun.js/resolve.test.js b/test/bun.js/resolve.test.js
index 6d8daedc5..1ae00306e 100644
--- a/test/bun.js/resolve.test.js
+++ b/test/bun.js/resolve.test.js
@@ -7,19 +7,19 @@ it("#imports", async () => {
const baz = await import.meta.resolve(
"#foo",
- join(await import.meta.resolve("package-json-imports/baz"), "../")
+ join(await import.meta.resolve("package-json-imports/baz"), "../"),
);
expect(baz.endsWith("foo/private-foo.js")).toBe(true);
const subpath = await import.meta.resolve(
"#foo/bar",
- join(await import.meta.resolve("package-json-imports/baz"), "../")
+ join(await import.meta.resolve("package-json-imports/baz"), "../"),
);
expect(subpath.endsWith("foo/private-foo.js")).toBe(true);
const react = await import.meta.resolve(
"#internal-react",
- join(await import.meta.resolve("package-json-imports/baz"), "../")
+ join(await import.meta.resolve("package-json-imports/baz"), "../"),
);
expect(react.endsWith("/react/index.js")).toBe(true);
@@ -52,7 +52,7 @@ it("#imports with wildcard", async () => {
expect(
(
await import.meta.resolve("package-json-imports/#foo/wildcard.js")
- ).endsWith("/wildcard.js")
+ ).endsWith("/wildcard.js"),
).toBe(true);
});
@@ -60,20 +60,20 @@ it("import.meta.resolve", async () => {
expect(await import.meta.resolve("./resolve.test.js")).toBe(import.meta.path);
expect(await import.meta.resolve("./resolve.test.js", import.meta.path)).toBe(
- import.meta.path
+ import.meta.path,
);
expect(
// optional second param can be any path, including a dir
await import.meta.resolve(
"./bun.js/resolve.test.js",
- join(import.meta.path, "../")
- )
+ join(import.meta.path, "../"),
+ ),
).toBe(import.meta.path);
// can be a package path
expect(
- (await import.meta.resolve("react", import.meta.path)).length > 0
+ (await import.meta.resolve("react", import.meta.path)).length > 0,
).toBe(true);
// file extensions are optional
@@ -81,22 +81,22 @@ it("import.meta.resolve", async () => {
// works with tsconfig.json "paths"
expect(await import.meta.resolve("foo/bar")).toBe(
- join(import.meta.path, "../baz.js")
+ join(import.meta.path, "../baz.js"),
);
// works with package.json "exports"
writePackageJSONExportsFixture();
expect(await import.meta.resolve("package-json-exports/baz")).toBe(
- join(import.meta.path, "../node_modules/package-json-exports/foo/bar.js")
+ join(import.meta.path, "../node_modules/package-json-exports/foo/bar.js"),
);
// works with TypeScript compiler edgecases like:
// - If the file ends with .js and it doesn't exist, try again with .ts and .tsx
expect(await import.meta.resolve("./resolve-typescript-file.js")).toBe(
- join(import.meta.path, "../resolve-typescript-file.tsx")
+ join(import.meta.path, "../resolve-typescript-file.tsx"),
);
expect(await import.meta.resolve("./resolve-typescript-file.tsx")).toBe(
- join(import.meta.path, "../resolve-typescript-file.tsx")
+ join(import.meta.path, "../resolve-typescript-file.tsx"),
);
// throws a ResolveError on failure
@@ -114,14 +114,14 @@ it("import.meta.resolve", async () => {
// and expects a directory instead of a filepath
it("Bun.resolve", async () => {
expect(await Bun.resolve("./resolve.test.js", import.meta.dir)).toBe(
- import.meta.path
+ import.meta.path,
);
});
// synchronous
it("Bun.resolveSync", () => {
expect(Bun.resolveSync("./resolve.test.js", import.meta.dir)).toBe(
- import.meta.path
+ import.meta.path,
);
});
@@ -130,7 +130,7 @@ it("self-referencing imports works", async () => {
const baz = await import.meta.resolve("package-json-exports/baz");
const namespace = await import.meta.resolve(
- "package-json-exports/references-baz"
+ "package-json-exports/references-baz",
);
Loader.registry.delete(baz);
Loader.registry.delete(namespace);
@@ -175,19 +175,19 @@ function writePackageJSONExportsFixture() {
join(import.meta.dir, "./node_modules/package-json-exports/foo"),
{
recursive: true,
- }
+ },
);
} catch (exception) {}
writeFileSync(
join(import.meta.dir, "./node_modules/package-json-exports/foo/bar.js"),
- "export const bar = 1;"
+ "export const bar = 1;",
);
writeFileSync(
join(
import.meta.dir,
- "./node_modules/package-json-exports/foo/references-baz.js"
+ "./node_modules/package-json-exports/foo/references-baz.js",
),
- "export {bar} from 'package-json-exports/baz';"
+ "export {bar} from 'package-json-exports/baz';",
);
writeFileSync(
join(import.meta.dir, "./node_modules/package-json-exports/package.json"),
@@ -200,8 +200,8 @@ function writePackageJSONExportsFixture() {
},
},
null,
- 2
- )
+ 2,
+ ),
);
}
@@ -211,26 +211,26 @@ function writePackageJSONImportsFixture() {
join(import.meta.dir, "./node_modules/package-json-imports/foo"),
{
recursive: true,
- }
+ },
);
} catch (exception) {}
writeFileSync(
join(import.meta.dir, "./node_modules/package-json-imports/foo/bar.js"),
- "export const bar = 1;"
+ "export const bar = 1;",
);
writeFileSync(
join(
import.meta.dir,
- "./node_modules/package-json-imports/foo/wildcard.js"
+ "./node_modules/package-json-imports/foo/wildcard.js",
),
- "export const wildcard = 1;"
+ "export const wildcard = 1;",
);
writeFileSync(
join(
import.meta.dir,
- "./node_modules/package-json-imports/foo/private-foo.js"
+ "./node_modules/package-json-imports/foo/private-foo.js",
),
- "export {bar} from 'package-json-imports/#foo';"
+ "export {bar} from 'package-json-imports/#foo';",
);
writeFileSync(
join(import.meta.dir, "./node_modules/package-json-imports/package.json"),
@@ -248,7 +248,7 @@ function writePackageJSONImportsFixture() {
},
},
null,
- 2
- )
+ 2,
+ ),
);
}
diff --git a/test/bun.js/serve.test.ts b/test/bun.js/serve.test.ts
index c033aaeb3..ea175dca5 100644
--- a/test/bun.js/serve.test.ts
+++ b/test/bun.js/serve.test.ts
@@ -90,13 +90,13 @@ describe("streaming", () => {
pull(controller) {
throw new Error("error");
},
- })
+ }),
);
},
});
const response = await fetch(
- `http://${server.hostname}:${server.port}`
+ `http://${server.hostname}:${server.port}`,
);
if (response.status > 0) {
expect(response.status).toBe(500);
@@ -132,13 +132,13 @@ describe("streaming", () => {
controller.enqueue("such fail");
throw new Error("error");
},
- })
+ }),
);
},
});
const response = await fetch(
- `http://${server.hostname}:${server.port}`
+ `http://${server.hostname}:${server.port}`,
);
// connection terminated
if (response.status > 0) {
@@ -167,7 +167,7 @@ describe("streaming", () => {
controller.enqueue(textToExpect);
controller.close();
},
- })
+ }),
);
},
});
@@ -192,7 +192,7 @@ describe("streaming", () => {
controller.enqueue(textToExpect.substring(100));
controller.close();
},
- })
+ }),
);
},
});
@@ -214,7 +214,7 @@ describe("streaming", () => {
start(controller) {
throw new TestPass("Test Passed");
},
- })
+ }),
);
},
});
@@ -222,7 +222,7 @@ describe("streaming", () => {
var response;
try {
response = await fetch(`http://${server.hostname}:${server.port}`);
- } catch (e) {
+ } catch (e: any) {
if (e.name !== "ConnectionClosed") {
throw e;
}
@@ -260,7 +260,7 @@ describe("streaming", () => {
start(controller) {
throw new TypeError("error");
},
- })
+ }),
);
},
});
@@ -294,7 +294,7 @@ describe("streaming", () => {
controller.close();
});
},
- })
+ }),
);
},
});
@@ -316,7 +316,7 @@ describe("streaming", () => {
controller.enqueue(textToExpect);
controller.close();
},
- })
+ }),
);
},
});
@@ -342,7 +342,7 @@ describe("streaming", () => {
controller.close();
});
},
- })
+ }),
);
},
});
@@ -367,7 +367,7 @@ describe("streaming", () => {
await Promise.resolve();
controller.close();
},
- })
+ }),
);
},
});
@@ -396,7 +396,7 @@ describe("streaming", () => {
controller.enqueue(remain);
controller.close();
},
- })
+ }),
);
},
});
diff --git a/test/bun.js/snapshots.debug.js b/test/bun.js/snapshots.debug.js
index d4c345677..e130188c0 100644
--- a/test/bun.js/snapshots.debug.js
+++ b/test/bun.js/snapshots.debug.js
@@ -1,9 +1,8 @@
-
// test/bun.js/module-require.snapshot.js
-import {
-__require as require
-} from "bun:wrap";
-console.log(import.meta.require("/Users/jarred/Code/bun/node_modules/react/index.js"));
+import { __require as require } from "bun:wrap";
+console.log(
+ import.meta.require("/Users/jarred/Code/bun/node_modules/react/index.js"),
+);
// test/bun.js/require-referenceerror.snapshot.js
diff --git a/test/bun.js/snapshots.js b/test/bun.js/snapshots.js
index d4c345677..e130188c0 100644
--- a/test/bun.js/snapshots.js
+++ b/test/bun.js/snapshots.js
@@ -1,9 +1,8 @@
-
// test/bun.js/module-require.snapshot.js
-import {
-__require as require
-} from "bun:wrap";
-console.log(import.meta.require("/Users/jarred/Code/bun/node_modules/react/index.js"));
+import { __require as require } from "bun:wrap";
+console.log(
+ import.meta.require("/Users/jarred/Code/bun/node_modules/react/index.js"),
+);
// test/bun.js/require-referenceerror.snapshot.js
diff --git a/test/bun.js/solid-dom-fixtures/SVG/code.js b/test/bun.js/solid-dom-fixtures/SVG/code.js
index 0ffded054..9f8b508f7 100644
--- a/test/bun.js/solid-dom-fixtures/SVG/code.js
+++ b/test/bun.js/solid-dom-fixtures/SVG/code.js
@@ -11,7 +11,7 @@ const template = (
style="fill:red;stroke:black;stroke-width:5;opacity:0.5"
/>
<linearGradient gradientTransform="rotate(25)">
- <stop offset="0%"></stop>
+ <stop offset="0%" />
</linearGradient>
</svg>
);
diff --git a/test/bun.js/solid-dom-fixtures/attributeExpressions/code.js b/test/bun.js/solid-dom-fixtures/attributeExpressions/code.js
index b64949434..e6822ec0c 100644
--- a/test/bun.js/solid-dom-fixtures/attributeExpressions/code.js
+++ b/test/bun.js/solid-dom-fixtures/attributeExpressions/code.js
@@ -46,7 +46,7 @@ const template4 = (
<div class="hi" className={state.class} classList={{ "ccc:ddd": true }} />
);
-const template5 = <div class="a" className="b"></div>;
+const template5 = <div class="a" className="b" />;
const template6 = <div style={someStyle()} textContent="Hi" />;
diff --git a/test/bun.js/solid-dom-fixtures/customElements/code.js b/test/bun.js/solid-dom-fixtures/customElements/code.js
index f2e2bd02d..bc844b7d8 100644
--- a/test/bun.js/solid-dom-fixtures/customElements/code.js
+++ b/test/bun.js/solid-dom-fixtures/customElements/code.js
@@ -24,6 +24,6 @@ const template3 = (
const template4 = (
<>
- <slot name="head"></slot>
+ <slot name="head" />
</>
);
diff --git a/test/bun.js/some-fs.js b/test/bun.js/some-fs.js
index e6b31f162..b22423dc7 100644
--- a/test/bun.js/some-fs.js
+++ b/test/bun.js/some-fs.js
@@ -16,7 +16,7 @@ for (let i = 0; i < count; i++) {
if (existsSync(tempdir)) {
throw new Error(
- `existsSync reports ${tempdir} exists, but it probably does not`
+ `existsSync reports ${tempdir} exists, but it probably does not`,
);
}
@@ -40,12 +40,12 @@ console.log("MKDIR " + total + " depth took:", performance.now() - start, "ms");
if (!existsSync(tempdir)) {
throw new Error(
- "Expected directory to exist after mkdirSync, but it doesn't"
+ "Expected directory to exist after mkdirSync, but it doesn't",
);
}
if (mkdirSync(tempdir, { recursive: true })) {
throw new Error(
- "mkdirSync shouldn't return directory name on existing directories"
+ "mkdirSync shouldn't return directory name on existing directories",
);
}
diff --git a/test/bun.js/spawn.test.ts b/test/bun.js/spawn.test.ts
index b3ac6ae5f..f8694bfcc 100644
--- a/test/bun.js/spawn.test.ts
+++ b/test/bun.js/spawn.test.ts
@@ -1,12 +1,12 @@
import { readableStreamToText, spawn, spawnSync, write } from "bun";
import { describe, expect, it } from "bun:test";
-import { gcTick as _gcTick } from "gc";
+import { gcTick as _gcTick } from "./gc";
import { rmdirSync, unlinkSync, rmSync, writeFileSync } from "node:fs";
for (let [gcTick, label] of [
[_gcTick, "gcTick"],
[() => {}, "no gc tick"],
-]) {
+] as const) {
describe(label, () => {
describe("spawnSync", () => {
const hugeString = "hello".repeat(10000).slice();
@@ -15,7 +15,7 @@ for (let [gcTick, label] of [
const { stdout } = spawnSync(["echo", "hi"]);
// stdout is a Buffer
- const text = stdout.toString();
+ const text = stdout!.toString();
expect(text).toBe("hi\n");
});
@@ -25,8 +25,8 @@ for (let [gcTick, label] of [
stdin: new TextEncoder().encode(hugeString),
});
- expect(stdout.toString()).toBe(hugeString);
- expect(stderr.byteLength).toBe(0);
+ expect(stdout!.toString()).toBe(hugeString);
+ expect(stderr!.byteLength).toBe(0);
});
it("check exit code", async () => {
@@ -94,7 +94,7 @@ for (let [gcTick, label] of [
it("check exit code from onExit", async () => {
var exitCode1, exitCode2;
- await new Promise((resolve) => {
+ await new Promise<void>((resolve) => {
var counter = 0;
spawn({
cmd: ["ls"],
@@ -156,7 +156,7 @@ for (let [gcTick, label] of [
stdin: Bun.file("/tmp/out.456.txt"),
});
gcTick();
- expect(await readableStreamToText(stdout)).toBe("hello there!");
+ expect(await readableStreamToText(stdout!)).toBe("hello there!");
});
it("Bun.file() works as stdin and stdout", async () => {
@@ -184,9 +184,10 @@ for (let [gcTick, label] of [
cmd: ["cat", "/tmp/out.txt"],
stdout: "pipe",
});
+
gcTick();
- const text = await readableStreamToText(stdout);
+ const text = await readableStreamToText(stdout!);
gcTick();
expect(text).toBe(hugeString);
});
@@ -220,17 +221,18 @@ for (let [gcTick, label] of [
stdin: "pipe",
stderr: "inherit",
});
- proc.stdin.write(hugeString);
- await proc.stdin.end(true);
+
+ proc.stdin!.write(hugeString);
+ await proc.stdin!.end();
var text = "";
- var reader = proc.stdout.getReader();
+ var reader = proc.stdout!.getReader();
var done = false;
while (!done) {
var { value, done } = await reader.read();
if (value) text += new TextDecoder().decode(value);
if (done && text.length === 0) {
reader.releaseLock();
- reader = proc.stdout.getReader();
+ reader = proc.stdout!.getReader();
done = false;
}
}
@@ -262,14 +264,14 @@ for (let [gcTick, label] of [
const fixtures = [
[helloWorld, "hello"],
[huge, hugeString],
- ];
+ ] as const;
for (const [callback, fixture] of fixtures) {
describe(fixture.slice(0, 12), () => {
describe("should should allow reading stdout", () => {
it("before exit", async () => {
const process = callback();
- const output = await readableStreamToText(process.stdout);
+ const output = await readableStreamToText(process.stdout!);
const expected = fixture + "\n";
expect(output.length).toBe(expected.length);
expect(output).toBe(expected);
@@ -280,7 +282,7 @@ for (let [gcTick, label] of [
it("before exit (chunked)", async () => {
const process = callback();
var output = "";
- var reader = process.stdout.getReader();
+ var reader = process.stdout!.getReader();
var done = false;
while (!done) {
var { value, done } = await reader.read();
@@ -296,9 +298,9 @@ for (let [gcTick, label] of [
it("after exit", async () => {
const process = callback();
- await process.stdin.end();
+ await process.stdin!.end();
- const output = await readableStreamToText(process.stdout);
+ const output = await readableStreamToText(process.stdout!);
const expected = fixture + "\n";
expect(output.length).toBe(expected.length);
diff --git a/test/bun.js/sql-raw.test.js b/test/bun.js/sql-raw.test.js
index e4dd1db82..6cf052e0e 100644
--- a/test/bun.js/sql-raw.test.js
+++ b/test/bun.js/sql-raw.test.js
@@ -8,10 +8,10 @@ it("works", () => {
const stmt = SQL.prepare(
handle,
- 'SELECT * FROM "Orders" WHERE OrderDate > date($date)'
+ 'SELECT * FROM "Orders" WHERE OrderDate > date($date)',
);
expect(stmt.toString()).toBe(
- `SELECT * FROM "Orders" WHERE OrderDate > date(NULL)`
+ `SELECT * FROM "Orders" WHERE OrderDate > date(NULL)`,
);
expect(
@@ -19,37 +19,37 @@ it("works", () => {
stmt.all({
// do the conversion this way so that this test runs in multiple timezones
$date: new Date(
- new Date(1996, 8, 1, 0, 0, 0, 0).toUTCString()
+ new Date(1996, 8, 1, 0, 0, 0, 0).toUTCString(),
).toISOString(),
- })
- )
+ }),
+ ),
).toBe(true);
expect(stmt.toString()).toBe(
- `SELECT * FROM "Orders" WHERE OrderDate > date('1996-09-01T07:00:00.000Z')`
+ `SELECT * FROM "Orders" WHERE OrderDate > date('1996-09-01T07:00:00.000Z')`,
);
var ran = stmt.run({
$date: new Date(
- new Date(1997, 8, 1, 0, 0, 0, 0).toUTCString()
+ new Date(1997, 8, 1, 0, 0, 0, 0).toUTCString(),
).toISOString(),
});
expect(Array.isArray(ran)).toBe(false);
expect(ran === undefined).toBe(true);
expect(stmt.toString()).toBe(
- `SELECT * FROM "Orders" WHERE OrderDate > date('1997-09-01T07:00:00.000Z')`
+ `SELECT * FROM "Orders" WHERE OrderDate > date('1997-09-01T07:00:00.000Z')`,
);
expect(
Array.isArray(
stmt.get({
$date: new Date(
- new Date(1998, 8, 1, 0, 0, 0, 0).toUTCString()
+ new Date(1998, 8, 1, 0, 0, 0, 0).toUTCString(),
).toISOString(),
- })
- )
+ }),
+ ),
).toBe(false);
expect(stmt.toString()).toBe(
- `SELECT * FROM "Orders" WHERE OrderDate > date('1998-09-01T07:00:00.000Z')`
+ `SELECT * FROM "Orders" WHERE OrderDate > date('1998-09-01T07:00:00.000Z')`,
);
expect(stmt.paramsCount).toBe(1);
expect(stmt.columnsCount).toBe(14);
@@ -65,7 +65,7 @@ it("SQL.run works", () => {
expect(
SQL.run(handle, 'SELECT * FROM "Orders" WHERE OrderDate > date($date)', {
$date: new Date(1996, 8, 1).toISOString(),
- })
+ }),
).toBe(undefined);
SQL.close(handle);
diff --git a/test/bun.js/sqlite.test.js b/test/bun.js/sqlite.test.js
index 96d106b65..4ca236819 100644
--- a/test/bun.js/sqlite.test.js
+++ b/test/bun.js/sqlite.test.js
@@ -1,14 +1,14 @@
import { expect, it, describe } from "bun:test";
import { Database, constants } from "bun:sqlite";
import { existsSync, fstat, writeFileSync } from "fs";
-var encode = (text) => new TextEncoder().encode(text)
+var encode = (text) => new TextEncoder().encode(text);
it("Database.open", () => {
// in a folder which doesn't exist
try {
Database.open(
"/this/database/does/not/exist.sqlite",
- constants.SQLITE_OPEN_READWRITE
+ constants.SQLITE_OPEN_READWRITE,
);
throw new Error("Expected an error to be thrown");
} catch (error) {
@@ -19,7 +19,7 @@ it("Database.open", () => {
try {
Database.open(
`/tmp/database-${Math.random()}.sqlite`,
- constants.SQLITE_OPEN_READWRITE
+ constants.SQLITE_OPEN_READWRITE,
);
throw new Error("Expected an error to be thrown");
} catch (error) {
@@ -58,10 +58,10 @@ it("Database.open", () => {
it("creates", () => {
const db = Database.open(":memory:");
db.exec(
- "CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT, value INTEGER, created TEXT, deci FLOAT, blobby BLOB)"
+ "CREATE TABLE test (id INTEGER PRIMARY KEY, name TEXT, value INTEGER, created TEXT, deci FLOAT, blobby BLOB)",
);
const stmt = db.prepare(
- "INSERT INTO test (name, value, deci, created, blobby) VALUES (?, ?, ?, ?, ?)"
+ "INSERT INTO test (name, value, deci, created, blobby) VALUES (?, ?, ?, ?, ?)",
);
stmt.run([
@@ -97,7 +97,7 @@ it("creates", () => {
created: new Date(1995, 12, 19).toISOString(),
deci: Math.fround(1.111),
blobby: encode("Hello World"),
- })
+ }),
);
expect(JSON.stringify(stmt2.all())).toBe(
@@ -126,7 +126,7 @@ it("creates", () => {
deci: Math.fround(3.333),
blobby: encode("Hello World"),
},
- ])
+ ]),
);
expect(stmt2.run()).toBe(undefined);
@@ -193,7 +193,7 @@ it("db.query supports TypedArray", () => {
JSON.stringify({
id: 1,
blobby: encode("Hello World"),
- })
+ }),
);
const stmt3 = db.prepare("SELECT * FROM test WHERE (blobby = ?)");
@@ -202,20 +202,20 @@ it("db.query supports TypedArray", () => {
JSON.stringify({
id: 1,
blobby: encode("Hello World"),
- })
+ }),
);
expect(
JSON.stringify(
db
.query("SELECT * FROM test WHERE (blobby = ?)")
- .get([encode("Hello World")])
- )
+ .get([encode("Hello World")]),
+ ),
).toBe(
JSON.stringify({
id: 1,
blobby: encode("Hello World"),
- })
+ }),
);
expect(stmt3.get([encode("Hello World NOT")])).toBe(null);
@@ -235,7 +235,7 @@ it("supports serialize/deserialize", () => {
JSON.stringify({
id: 1,
name: "Hello",
- })
+ }),
);
expect(JSON.stringify(stmt.all())).toBe(
@@ -248,7 +248,7 @@ it("supports serialize/deserialize", () => {
id: 2,
name: "World",
},
- ])
+ ]),
);
db2.exec("insert into test (name) values ('foo')");
expect(JSON.stringify(stmt.all())).toBe(
@@ -265,7 +265,7 @@ it("supports serialize/deserialize", () => {
id: 3,
name: "foo",
},
- ])
+ ]),
);
const db3 = new Database(input, { readonly: true });
@@ -334,15 +334,15 @@ it("db.query()", () => {
JSON.stringify(
db
.query("SELECT * FROM test where (name = ? OR name = ?)")
- .all(["Hello", "Fooooo"])
- )
+ .all(["Hello", "Fooooo"]),
+ ),
).toBe(JSON.stringify([{ id: 1, name: "Hello" }]));
expect(
JSON.stringify(
db
.query("SELECT * FROM test where (name = ? OR name = ?)")
- .all("Hello", "Fooooo")
- )
+ .all("Hello", "Fooooo"),
+ ),
).toBe(JSON.stringify([{ id: 1, name: "Hello" }]));
// throws if insufficeint arguments
@@ -360,8 +360,8 @@ it("db.query()", () => {
.all({
$hello: "Hello",
$goodbye: "Fooooo",
- })
- )
+ }),
+ ),
).toBe(JSON.stringify([{ id: 1, name: "Hello" }]));
db.close();
@@ -386,11 +386,11 @@ it("db.transaction()", () => {
const db = Database.open(":memory:");
db.exec(
- "CREATE TABLE cats (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT UNIQUE, age INTEGER)"
+ "CREATE TABLE cats (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT UNIQUE, age INTEGER)",
);
const insert = db.prepare(
- "INSERT INTO cats (name, age) VALUES (@name, @age)"
+ "INSERT INTO cats (name, age) VALUES (@name, @age)",
);
expect(db.inTransaction).toBe(false);
diff --git a/test/bun.js/streams.test.js b/test/bun.js/streams.test.js
index d18aae84a..c6d69ab08 100644
--- a/test/bun.js/streams.test.js
+++ b/test/bun.js/streams.test.js
@@ -455,7 +455,7 @@ it("ReadableStream for Blob", async () => {
chunks.push(new TextDecoder().decode(chunk.value));
}
expect(chunks.join("")).toBe(
- new TextDecoder().decode(Buffer.from("abdefghijklmnop"))
+ new TextDecoder().decode(Buffer.from("abdefghijklmnop")),
);
});
diff --git a/test/bun.js/string-decoder.test.js b/test/bun.js/string-decoder.test.js
index 8f3ad7695..4664cc388 100644
--- a/test/bun.js/string-decoder.test.js
+++ b/test/bun.js/string-decoder.test.js
@@ -2,10 +2,10 @@ import { expect, it } from "bun:test";
import { StringDecoder } from "string_decoder";
it("StringDecoder-utf8", () => {
- test('utf-8', Buffer.from('$', 'utf-8'), '$');
- test('utf-8', Buffer.from('¢', 'utf-8'), '¢');
- test('utf-8', Buffer.from('€', 'utf-8'), '€');
- test('utf-8', Buffer.from('𤭢', 'utf-8'), '𤭢');
+ test("utf-8", Buffer.from("$", "utf-8"), "$");
+ test("utf-8", Buffer.from("¢", "utf-8"), "¢");
+ test("utf-8", Buffer.from("€", "utf-8"), "€");
+ test("utf-8", Buffer.from("𤭢", "utf-8"), "𤭢");
// A mixed ascii and non-ascii string
// Test stolen from deps/v8/test/cctest/test-strings.cc
// U+02E4 -> CB A4
@@ -14,67 +14,69 @@ it("StringDecoder-utf8", () => {
// U+0030 -> 30
// U+3045 -> E3 81 85
test(
- 'utf-8',
- Buffer.from([0xCB, 0xA4, 0x64, 0xE1, 0x8B, 0xA4, 0x30, 0xE3, 0x81, 0x85]),
- '\u02e4\u0064\u12e4\u0030\u3045'
+ "utf-8",
+ Buffer.from([0xcb, 0xa4, 0x64, 0xe1, 0x8b, 0xa4, 0x30, 0xe3, 0x81, 0x85]),
+ "\u02e4\u0064\u12e4\u0030\u3045",
);
});
it("StringDecoder-ucs-2", () => {
- test('ucs2', Buffer.from('ababc', 'ucs2'), 'ababc');
+ test("ucs2", Buffer.from("ababc", "ucs2"), "ababc");
});
it("StringDecoder-utf16le", () => {
- test('utf16le', Buffer.from('3DD84DDC', 'hex'), '\ud83d\udc4d');
+ test("utf16le", Buffer.from("3DD84DDC", "hex"), "\ud83d\udc4d");
});
it("StringDecoder-utf8-additional", () => {
- let decoder = new StringDecoder('utf8');
- expect(decoder.write(Buffer.from('E18B', 'hex'))).toBe('');
- expect(decoder.end()).toBe('\ufffd');
+ let decoder = new StringDecoder("utf8");
+ expect(decoder.write(Buffer.from("E18B", "hex"))).toBe("");
+ expect(decoder.end()).toBe("\ufffd");
- decoder = new StringDecoder('utf8');
- expect(decoder.write(Buffer.from('\ufffd'))).toBe('\ufffd');
- expect(decoder.end()).toBe('');
+ decoder = new StringDecoder("utf8");
+ expect(decoder.write(Buffer.from("\ufffd"))).toBe("\ufffd");
+ expect(decoder.end()).toBe("");
- decoder = new StringDecoder('utf8');
- expect(decoder.write(Buffer.from('\ufffd\ufffd\ufffd'))).toBe('\ufffd\ufffd\ufffd');
- expect(decoder.end()).toBe('');
+ decoder = new StringDecoder("utf8");
+ expect(decoder.write(Buffer.from("\ufffd\ufffd\ufffd"))).toBe(
+ "\ufffd\ufffd\ufffd",
+ );
+ expect(decoder.end()).toBe("");
- decoder = new StringDecoder('utf8');
- expect(decoder.write(Buffer.from('EFBFBDE2', 'hex'))).toBe('\ufffd');
- expect(decoder.end()).toBe('\ufffd');
+ decoder = new StringDecoder("utf8");
+ expect(decoder.write(Buffer.from("EFBFBDE2", "hex"))).toBe("\ufffd");
+ expect(decoder.end()).toBe("\ufffd");
- decoder = new StringDecoder('utf8');
- expect(decoder.write(Buffer.from('F1', 'hex'))).toBe('');
- expect(decoder.write(Buffer.from('41F2', 'hex'))).toBe('\ufffdA');
- expect(decoder.end()).toBe('\ufffd');
+ decoder = new StringDecoder("utf8");
+ expect(decoder.write(Buffer.from("F1", "hex"))).toBe("");
+ expect(decoder.write(Buffer.from("41F2", "hex"))).toBe("\ufffdA");
+ expect(decoder.end()).toBe("\ufffd");
// Additional utf8Text test
- decoder = new StringDecoder('utf8');
- expect(decoder.text(Buffer.from([0x41]), 2)).toBe('');
+ decoder = new StringDecoder("utf8");
+ expect(decoder.text(Buffer.from([0x41]), 2)).toBe("");
});
it("StringDecoder-utf16le-additional", () => {
// Additional UTF-16LE surrogate pair tests
- let decoder = new StringDecoder('utf16le');
- expect(decoder.write(Buffer.from('3DD8', 'hex'))).toBe('');
- expect(decoder.write(Buffer.from('4D', 'hex'))).toBe('');
- expect(decoder.write(Buffer.from('DC', 'hex'))).toBe('\ud83d\udc4d');
- expect(decoder.end()).toBe('');
+ let decoder = new StringDecoder("utf16le");
+ expect(decoder.write(Buffer.from("3DD8", "hex"))).toBe("");
+ expect(decoder.write(Buffer.from("4D", "hex"))).toBe("");
+ expect(decoder.write(Buffer.from("DC", "hex"))).toBe("\ud83d\udc4d");
+ expect(decoder.end()).toBe("");
- decoder = new StringDecoder('utf16le');
- expect(decoder.write(Buffer.from('3DD8', 'hex'))).toBe('');
- expect(decoder.end()).toBe('\ud83d');
+ decoder = new StringDecoder("utf16le");
+ expect(decoder.write(Buffer.from("3DD8", "hex"))).toBe("");
+ expect(decoder.end()).toBe("\ud83d");
- decoder = new StringDecoder('utf16le');
- expect(decoder.write(Buffer.from('3DD8', 'hex'))).toBe('');
- expect(decoder.write(Buffer.from('4D', 'hex'))).toBe('');
- expect(decoder.end()).toBe('\ud83d');
+ decoder = new StringDecoder("utf16le");
+ expect(decoder.write(Buffer.from("3DD8", "hex"))).toBe("");
+ expect(decoder.write(Buffer.from("4D", "hex"))).toBe("");
+ expect(decoder.end()).toBe("\ud83d");
- decoder = new StringDecoder('utf16le');
- expect(decoder.write(Buffer.from('3DD84D', 'hex'))).toBe('\ud83d');
- expect(decoder.end()).toBe('');
+ decoder = new StringDecoder("utf16le");
+ expect(decoder.write(Buffer.from("3DD84D", "hex"))).toBe("\ud83d");
+ expect(decoder.end()).toBe("");
});
// Test verifies that StringDecoder will correctly decode the given input
@@ -91,7 +93,7 @@ function test(encoding, input, expected, singleSequence) {
}
sequences.forEach((sequence) => {
const decoder = new StringDecoder(encoding);
- let output = '';
+ let output = "";
sequence.forEach((write) => {
output += decoder.write(input.slice(write[0], write[1]));
});
diff --git a/test/bun.js/tcp-server.test.ts b/test/bun.js/tcp-server.test.ts
index 8b3b21820..65dd069a6 100644
--- a/test/bun.js/tcp-server.test.ts
+++ b/test/bun.js/tcp-server.test.ts
@@ -1,5 +1,5 @@
-import { listen, connect, finalizationCounter } from "bun";
-import { expect, describe, it } from "bun:test";
+import { listen, connect, TCPSocketListener } from "bun";
+import { expect, it } from "bun:test";
import * as JSC from "bun:jsc";
var decoder = new TextDecoder();
@@ -76,7 +76,7 @@ it("echo server 1 on 1", async () => {
},
};
- var server = listen({
+ var server: TCPSocketListener<any> | undefined = listen({
socket: handlers,
hostname: "localhost",
port: 8084,
@@ -103,7 +103,7 @@ it("echo server 1 on 1", async () => {
await new Promise((resolve, reject) => {
setTimeout(() => {
Bun.gc(true);
- resolve();
+ resolve(undefined);
}, 1);
});
diff --git a/test/bun.js/test_scope_debug.ts b/test/bun.js/test_scope_debug.ts
index 9af649552..fbc79acd8 100644
--- a/test/bun.js/test_scope_debug.ts
+++ b/test/bun.js/test_scope_debug.ts
@@ -1,3 +1,4 @@
+type AnyFunction = (...args: any[]) => any;
export function wrap({
test: test_,
it: it_,
@@ -6,12 +7,12 @@ export function wrap({
beforeAll: beforeAll_ = undefined,
afterEach: afterEach_ = undefined,
afterAll: afterAll_ = undefined,
-}) {
+}: any) {
if (it_ === undefined) {
it_ = test_;
}
- var describe = (label, cb) => {
+ var describe = (label, cb: AnyFunction) => {
return describe_(
label,
cb instanceof async function () {}.constructor
@@ -34,11 +35,11 @@ export function wrap({
} finally {
console.log(`DESCRIBE [Exit] ${label}`);
}
- }
+ },
);
};
- var it = (label, cb) => {
+ var it = (label, cb: AnyFunction) => {
console.log("Before", label);
return it_(
label,
@@ -62,11 +63,11 @@ export function wrap({
} finally {
console.log(`TEST [Exit] ${label}`);
}
- }
+ },
);
};
- var beforeEach = (cb) => {
+ var beforeEach = (cb: AnyFunction) => {
return beforeEach_(
cb instanceof async function () {}.constructor
? async () => {
@@ -88,10 +89,10 @@ export function wrap({
} finally {
console.log(`BEFORE EACH [Exit]`);
}
- }
+ },
);
};
- var beforeAll = (cb) => {
+ var beforeAll = (cb: AnyFunction) => {
return beforeAll_(
cb instanceof async function () {}.constructor
? async () => {
@@ -113,10 +114,10 @@ export function wrap({
} finally {
console.log(`BEFORE ALL [Exit]`);
}
- }
+ },
);
};
- var afterEach = (cb) => {
+ var afterEach = (cb: AnyFunction) => {
return afterEach_(
cb instanceof async function () {}.constructor
? async () => {
@@ -138,10 +139,10 @@ export function wrap({
} finally {
console.log(`AFTER EACH [Exit]`);
}
- }
+ },
);
};
- var afterAll = (cb) => {
+ var afterAll = (cb: AnyFunction) => {
return afterAll_(
cb instanceof async function () {}.constructor
? async () => {
@@ -163,7 +164,7 @@ export function wrap({
} finally {
console.log(`AFTER ALL [Exit]`);
}
- }
+ },
);
};
diff --git a/test/bun.js/text-decoder.test.js b/test/bun.js/text-decoder.test.js
index 417a4c23a..2a88a8bc8 100644
--- a/test/bun.js/text-decoder.test.js
+++ b/test/bun.js/text-decoder.test.js
@@ -24,7 +24,7 @@ describe("TextDecoder", () => {
const result = [72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33];
gcTrace(true);
expect(decoder.decode(Uint8Array.from(result))).toBe(
- String.fromCharCode(...result)
+ String.fromCharCode(...result),
);
gcTrace(true);
});
diff --git a/test/bun.js/text-encoder.test.js b/test/bun.js/text-encoder.test.js
index 2c8f9acf4..90255323f 100644
--- a/test/bun.js/text-encoder.test.js
+++ b/test/bun.js/text-encoder.test.js
@@ -175,12 +175,12 @@ describe("TextEncoder", () => {
it(t.encoding + " - " + t.name, () => {
gcTrace(true);
expect(
- new TextDecoder(t.encoding).decode(new Uint8Array(t.input))
+ new TextDecoder(t.encoding).decode(new Uint8Array(t.input)),
).toBe(t.expected);
expect(
new TextDecoder(t.encoding).decode(
- new Uint16Array(new Uint8Array(t.input).buffer)
- )
+ new Uint16Array(new Uint8Array(t.input).buffer),
+ ),
).toBe(t.expected);
gcTrace(true);
});
diff --git a/test/bun.js/toml.test.js b/test/bun.js/toml.test.js
index 44141b2d4..900d30bf0 100644
--- a/test/bun.js/toml.test.js
+++ b/test/bun.js/toml.test.js
@@ -20,10 +20,10 @@ it("syntax", async () => {
expect(toml.inline.array[1]).toBe(4);
expect(toml.dev["foo.bar"]).toBe("baz");
expect(toml.install.scopes["@mybigcompany"].url).toBe(
- "https://registry.mybigcompany.com"
+ "https://registry.mybigcompany.com",
);
expect(toml.install.scopes["@mybigcompany2"].url).toBe(
- "https://registry.mybigcompany.com"
+ "https://registry.mybigcompany.com",
);
expect(toml.install.scopes["@mybigcompany3"].three).toBe(4);
gc();
diff --git a/test/bun.js/transpiler.test.js b/test/bun.js/transpiler.test.js
index 91803ef9b..c81b00ec5 100644
--- a/test/bun.js/transpiler.test.js
+++ b/test/bun.js/transpiler.test.js
@@ -68,7 +68,7 @@ describe("Bun.Transpiler", () => {
it("normalizes \\r\\n", () => {
ts.expectPrinted_(
"console.log(`\r\n\r\n\r\n`)",
- "console.log(`\n\n\n`);\n"
+ "console.log(`\n\n\n`);\n",
);
});
@@ -76,14 +76,14 @@ describe("Bun.Transpiler", () => {
it("import Foo = Baz.Bar", () => {
ts.expectPrinted_(
"import Foo = Baz.Bar;\nexport default Foo;",
- "const Foo = Baz.Bar;\nexport default Foo"
+ "const Foo = Baz.Bar;\nexport default Foo",
);
});
it("import Foo = require('bar')", () => {
ts.expectPrinted_(
"import React = require('react')",
- 'const React = require("react")'
+ 'const React = require("react")',
);
});
@@ -98,7 +98,7 @@ describe("Bun.Transpiler", () => {
it("export import Foo = Baz.Bar", () => {
ts.expectPrinted_(
"export import Foo = Baz.Bar;",
- "export const Foo = Baz.Bar"
+ "export const Foo = Baz.Bar",
);
});
@@ -472,75 +472,75 @@ export default <>hi</>
`export var foo = jsx("div", {
foo: true
}, undefined, false, undefined, this);
-`
+`,
);
expect(bun.transformSync("export var foo = <div foo={foo} />")).toBe(
`export var foo = jsx("div", {
foo
}, undefined, false, undefined, this);
-`
+`,
);
expect(bun.transformSync("export var foo = <div {...foo} />")).toBe(
`export var foo = jsx("div", {
...foo
}, undefined, false, undefined, this);
-`
+`,
);
expect(bun.transformSync("export var hi = <div {foo} />")).toBe(
`export var hi = jsx("div", {
foo
}, undefined, false, undefined, this);
-`
+`,
);
expect(bun.transformSync("export var hi = <div {foo.bar.baz} />")).toBe(
`export var hi = jsx("div", {
baz: foo.bar.baz
}, undefined, false, undefined, this);
-`
+`,
);
expect(bun.transformSync("export var hi = <div {foo?.bar?.baz} />")).toBe(
`export var hi = jsx("div", {
baz: foo?.bar?.baz
}, undefined, false, undefined, this);
-`
+`,
);
expect(
- bun.transformSync("export var hi = <div {foo['baz'].bar?.baz} />")
+ bun.transformSync("export var hi = <div {foo['baz'].bar?.baz} />"),
).toBe(
`export var hi = jsx("div", {
baz: foo["baz"].bar?.baz
}, undefined, false, undefined, this);
-`
+`,
);
// cursed
expect(
bun.transformSync(
- "export var hi = <div {foo[{name: () => true}.name].hi} />"
- )
+ "export var hi = <div {foo[{name: () => true}.name].hi} />",
+ ),
).toBe(
`export var hi = jsx("div", {
hi: foo[{ name: () => true }.name].hi
}, undefined, false, undefined, this);
-`
+`,
);
expect(
- bun.transformSync("export var hi = <Foo {process.env.NODE_ENV} />")
+ bun.transformSync("export var hi = <Foo {process.env.NODE_ENV} />"),
).toBe(
`export var hi = jsx(Foo, {
NODE_ENV: "development"
}, undefined, false, undefined, this);
-`
+`,
);
expect(
- bun.transformSync("export var hi = <div {foo['baz'].bar?.baz} />")
+ bun.transformSync("export var hi = <div {foo['baz'].bar?.baz} />"),
).toBe(
`export var hi = jsx("div", {
baz: foo["baz"].bar?.baz
}, undefined, false, undefined, this);
-`
+`,
);
try {
bun.transformSync("export var hi = <div {foo}={foo}= />");
@@ -550,22 +550,22 @@ export default <>hi</>
}
expect(
- bun.transformSync("export var hi = <div {Foo}><Foo></Foo></div>")
+ bun.transformSync("export var hi = <div {Foo}><Foo></Foo></div>"),
).toBe(
`export var hi = jsx("div", {
Foo,
children: jsx(Foo, {}, undefined, false, undefined, this)
}, undefined, false, undefined, this);
-`
+`,
);
expect(
- bun.transformSync("export var hi = <div {Foo}><Foo></Foo></div>")
+ bun.transformSync("export var hi = <div {Foo}><Foo></Foo></div>"),
).toBe(
`export var hi = jsx("div", {
Foo,
children: jsx(Foo, {}, undefined, false, undefined, this)
}, undefined, false, undefined, this);
-`
+`,
);
expect(bun.transformSync("export var hi = <div>{123}}</div>").trim()).toBe(
@@ -575,7 +575,7 @@ export default <>hi</>
"}"
]
}, undefined, true, undefined, this);
- `.trim()
+ `.trim(),
);
});
@@ -604,9 +604,9 @@ export var ComponentThatChecksDefaultProps = <Hello></Hello>
export var ComponentThatChecksDefaultPropsAndHasChildren = <Hello>my child</Hello>
export var ComponentThatHasSpreadCausesDeopt = <Hello {...spread} />
-`.trim()
+`.trim(),
)
- .trim()
+ .trim(),
).toBe(
`var $$typeof = Symbol.for("react.element");
export var hi = {
@@ -654,7 +654,7 @@ export var ComponentThatChecksDefaultPropsAndHasChildren = {
export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
...spread
});
-`.trim()
+`.trim(),
);
});
});
@@ -662,25 +662,25 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
it("require with a dynamic non-string expression", () => {
var nodeTranspiler = new Bun.Transpiler({ platform: "node" });
expect(nodeTranspiler.transformSync("require('hi' + bar)")).toBe(
- 'require("hi" + bar);\n'
+ 'require("hi" + bar);\n',
);
});
it("CommonJS", () => {
var nodeTranspiler = new Bun.Transpiler({ platform: "node" });
expect(nodeTranspiler.transformSync("module.require('hi' + 123)")).toBe(
- 'require("hi" + 123);\n'
+ 'require("hi" + 123);\n',
);
expect(
- nodeTranspiler.transformSync("module.require(1 ? 'foo' : 'bar')")
+ nodeTranspiler.transformSync("module.require(1 ? 'foo' : 'bar')"),
).toBe('require("foo");\n');
expect(nodeTranspiler.transformSync("require(1 ? 'foo' : 'bar')")).toBe(
- 'require("foo");\n'
+ 'require("foo");\n',
);
expect(
- nodeTranspiler.transformSync("module.require(unknown ? 'foo' : 'bar')")
+ nodeTranspiler.transformSync("module.require(unknown ? 'foo' : 'bar')"),
).toBe('unknown ? require("foo") : require("bar");\n');
});
@@ -732,7 +732,7 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
code,
trim = true,
autoExport = false,
- transpiler_ = transpiler
+ transpiler_ = transpiler,
) => {
if (autoExport) {
code = "export default (" + code + ")";
@@ -880,7 +880,7 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectPrinted_(
"async function f() { await delete x }",
- "async function f() {\n await delete x;\n}"
+ "async function f() {\n await delete x;\n}",
);
// expectParseError(
@@ -892,45 +892,45 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
it("import assert", () => {
expectPrinted_(
`import json from "./foo.json" assert { type: "json" };`,
- `import json from "./foo.json"`
+ `import json from "./foo.json"`,
);
expectPrinted_(
`import json from "./foo.json";`,
- `import json from "./foo.json"`
+ `import json from "./foo.json"`,
);
expectPrinted_(
`import("./foo.json", { type: "json" });`,
- `import("./foo.json")`
+ `import("./foo.json")`,
);
});
it("import with unicode escape", () => {
expectPrinted_(
`import { name } from 'mod\\u1011';`,
- `import {name} from "mod\\u1011"`
+ `import {name} from "mod\\u1011"`,
);
});
it("fold string addition", () => {
expectPrinted_(
`export const foo = "a" + "b";`,
- `export const foo = "ab"`
+ `export const foo = "ab"`,
);
expectPrinted_(
`export const foo = "F" + "0" + "F" + "0123456789" + "ABCDEF" + "0123456789ABCDEFF0123456789ABCDEF00" + "b";`,
- `export const foo = "F0F0123456789ABCDEF0123456789ABCDEFF0123456789ABCDEF00b"`
+ `export const foo = "F0F0123456789ABCDEF0123456789ABCDEFF0123456789ABCDEF00b"`,
);
expectPrinted_(
`export const foo = "a" + 1 + "b";`,
- `export const foo = "a" + 1 + "b"`
+ `export const foo = "a" + 1 + "b"`,
);
expectPrinted_(
`export const foo = "a" + "b" + 1 + "b";`,
- `export const foo = "ab" + 1 + "b"`
+ `export const foo = "ab" + 1 + "b"`,
);
expectPrinted_(
`export const foo = "a" + "b" + 1 + "b" + "c";`,
- `export const foo = "ab" + 1 + "bc"`
+ `export const foo = "ab" + 1 + "bc"`,
);
});
@@ -955,7 +955,7 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
return whatDidIPass();
}
`,
- object
+ object,
);
expect(output).toBe(`export function foo() {
return {
@@ -972,11 +972,11 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
it("rewrite string to length", () => {
expectPrinted_(
`export const foo = "a".length + "b".length;`,
- `export const foo = 1 + 1`
+ `export const foo = 1 + 1`,
);
expectBunPrinted_(
`export const foo = "a".length + "b".length;`,
- `export const foo = 2`
+ `export const foo = 2`,
);
});
@@ -984,21 +984,21 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
it("require -> import.meta.require", () => {
expectBunPrinted_(
`export const foo = require('bar.node')`,
- `export const foo = import.meta.require("bar.node")`
+ `export const foo = import.meta.require("bar.node")`,
);
});
it("require.resolve -> import.meta.resolveSync", () => {
expectBunPrinted_(
`export const foo = require.resolve('bar.node')`,
- `export const foo = import.meta.resolveSync("bar.node")`
+ `export const foo = import.meta.resolveSync("bar.node")`,
);
});
it('require.resolve(path, {paths: ["blah"]}) -> import.meta.resolveSync', () => {
expectBunPrinted_(
`export const foo = require.resolve('bar.node', {paths: ["blah"]})`,
- `export const foo = import.meta.resolveSync("bar.node", { paths: ["blah"] })`
+ `export const foo = import.meta.resolveSync("bar.node", { paths: ["blah"] })`,
);
});
});
@@ -1009,7 +1009,7 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
// so in this test, it becomes the same path string
expectPrinted_(
`export const foo = require.resolve('my-module')`,
- `export const foo = "my-module"`
+ `export const foo = "my-module"`,
);
});
});
@@ -1017,16 +1017,16 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
it("define", () => {
expectPrinted_(
`export default typeof user_undefined === 'undefined';`,
- `export default true`
+ `export default true`,
);
expectPrinted_(
`export default typeof user_undefined !== 'undefined';`,
- `export default false`
+ `export default false`,
);
expectPrinted_(
`export default typeof user_undefined !== 'undefined';`,
- `export default false`
+ `export default false`,
);
expectPrinted_(`export default !user_undefined;`, `export default true`);
});
@@ -1055,15 +1055,15 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
// expectParseError("for (let x;;) ;", "");
expectParseError(
"for (const x;;) ;",
- 'The constant "x" must be initialized'
+ 'The constant "x" must be initialized',
);
expectParseError(
"for (const {};;) ;",
- "This constant must be initialized"
+ "This constant must be initialized",
);
expectParseError(
"for (const [];;) ;",
- "This constant must be initialized"
+ "This constant must be initialized",
);
// Make sure bindings are visited during parsing
@@ -1076,23 +1076,23 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectPrinted_(
"export var foo = ([...x] = []) => {}",
- "export var foo = ([...x] = []) => {\n}"
+ "export var foo = ([...x] = []) => {\n}",
);
expectPrinted_(
"export var foo = ({...x} = {}) => {}",
- "export var foo = ({ ...x } = {}) => {\n}"
+ "export var foo = ({ ...x } = {}) => {\n}",
);
expectParseError("var [...x,] = []", 'Unexpected "," after rest pattern');
expectParseError("var {...x,} = {}", 'Unexpected "," after rest pattern');
expectParseError(
"export default function() { return ([...x,] = []) => {} }",
- "Unexpected trailing comma after rest element"
+ "Unexpected trailing comma after rest element",
);
expectParseError(
"({...x,} = {}) => {}",
- "Unexpected trailing comma after rest element"
+ "Unexpected trailing comma after rest element",
);
expectPrinted_("[b, ...c] = d", "[b, ...c] = d");
@@ -1123,16 +1123,16 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectParseError("({x: ({})} = {x: {}})", "Invalid assignment target");
expectParseError(
"(([]) = []) => {}",
- "Unexpected parentheses in binding pattern"
+ "Unexpected parentheses in binding pattern",
);
expectParseError(
"(({}) = {}) => {}",
- "Unexpected parentheses in binding pattern"
+ "Unexpected parentheses in binding pattern",
);
expectParseError("function f(([]) = []) {}", "Parse error");
expectParseError(
"function f(({}) = {}) {}",
- "Parse error"
+ "Parse error",
// 'Expected identifier but found "("\n'
);
@@ -1154,11 +1154,11 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectParseError("[{...a, b}] = c", 'Unexpected "," after rest pattern');
expectParseError(
"({x: [...a, b]} = c)",
- 'Unexpected "," after rest pattern'
+ 'Unexpected "," after rest pattern',
);
expectParseError(
"({x: {...a, b}} = c)",
- 'Unexpected "," after rest pattern'
+ 'Unexpected "," after rest pattern',
);
expectParseError("[b, ...c,] = d", 'Unexpected "," after rest pattern');
expectParseError("([b, ...c,] = d)", 'Unexpected "," after rest pattern');
@@ -1169,11 +1169,11 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectPrinted_(
"for ([{a = {}}] in b) {}",
- "for ([{ a = {} }] in b) {\n}"
+ "for ([{ a = {} }] in b) {\n}",
);
expectPrinted_(
"for ([{a = {}}] of b) {}",
- "for ([{ a = {} }] of b) {\n}"
+ "for ([{ a = {} }] of b) {\n}",
);
expectPrinted_("for ({a = {}} in b) {}", "for ({ a = {} } in b) {\n}");
expectPrinted_("for ({a = {}} of b) {}", "for ({ a = {} } of b) {\n}");
@@ -1182,11 +1182,11 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectParseError("[{a = {}}]\nof()", 'Unexpected "="');
expectParseError(
"for ([...a, b] in c) {}",
- 'Unexpected "," after rest pattern'
+ 'Unexpected "," after rest pattern',
);
expectParseError(
"for ([...a, b] of c) {}",
- 'Unexpected "," after rest pattern'
+ 'Unexpected "," after rest pattern',
);
});
@@ -1202,7 +1202,7 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectParseError(
"/x/msuygig",
- 'Duplicate flag "g" in regular expression'
+ 'Duplicate flag "g" in regular expression',
);
});
@@ -1210,11 +1210,11 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectPrinted_("var _\u0076\u0061\u0072", "var _var");
expectParseError(
"var \u0076\u0061\u0072",
- 'Expected identifier but found "\u0076\u0061\u0072"'
+ 'Expected identifier but found "\u0076\u0061\u0072"',
);
expectParseError(
"\\u0076\\u0061\\u0072 foo",
- "Unexpected \\u0076\\u0061\\u0072"
+ "Unexpected \\u0076\\u0061\\u0072",
);
expectPrinted_("foo._\u0076\u0061\u0072", "foo._var");
@@ -1233,108 +1233,108 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectParseError("({ #foo: 1 })", 'Expected identifier but found "#foo"');
expectParseError(
"class Foo { x = { #foo: 1 } }",
- 'Expected identifier but found "#foo"'
+ 'Expected identifier but found "#foo"',
);
expectParseError("class Foo { x = #foo }", 'Expected "in" but found "}"');
expectParseError(
"class Foo { #foo; foo() { delete this.#foo } }",
- 'Deleting the private name "#foo" is forbidden'
+ 'Deleting the private name "#foo" is forbidden',
);
expectParseError(
"class Foo { #foo; foo() { delete this?.#foo } }",
- 'Deleting the private name "#foo" is forbidden'
+ 'Deleting the private name "#foo" is forbidden',
);
expectParseError(
"class Foo extends Bar { #foo; foo() { super.#foo } }",
- 'Expected identifier but found "#foo"'
+ 'Expected identifier but found "#foo"',
);
expectParseError(
"class Foo { #foo = () => { for (#foo in this) ; } }",
- "Unexpected #foo"
+ "Unexpected #foo",
);
expectParseError(
"class Foo { #foo = () => { for (x = #foo in this) ; } }",
- "Unexpected #foo"
+ "Unexpected #foo",
);
expectPrinted_("class Foo { #foo }", "class Foo {\n #foo;\n}");
expectPrinted_("class Foo { #foo = 1 }", "class Foo {\n #foo = 1;\n}");
expectPrinted_(
"class Foo { #foo = #foo in this }",
- "class Foo {\n #foo = #foo in this;\n}"
+ "class Foo {\n #foo = #foo in this;\n}",
);
expectPrinted_(
"class Foo { #foo = #foo in (#bar in this); #bar }",
- "class Foo {\n #foo = #foo in (#bar in this);\n #bar;\n}"
+ "class Foo {\n #foo = #foo in (#bar in this);\n #bar;\n}",
);
expectPrinted_(
"class Foo { #foo() {} }",
- "class Foo {\n #foo() {\n }\n}"
+ "class Foo {\n #foo() {\n }\n}",
);
expectPrinted_(
"class Foo { get #foo() {} }",
- "class Foo {\n get #foo() {\n }\n}"
+ "class Foo {\n get #foo() {\n }\n}",
);
expectPrinted_(
"class Foo { set #foo(x) {} }",
- "class Foo {\n set #foo(x) {\n }\n}"
+ "class Foo {\n set #foo(x) {\n }\n}",
);
expectPrinted_(
"class Foo { static #foo }",
- "class Foo {\n static #foo;\n}"
+ "class Foo {\n static #foo;\n}",
);
expectPrinted_(
"class Foo { static #foo = 1 }",
- "class Foo {\n static #foo = 1;\n}"
+ "class Foo {\n static #foo = 1;\n}",
);
expectPrinted_(
"class Foo { static #foo() {} }",
- "class Foo {\n static #foo() {\n }\n}"
+ "class Foo {\n static #foo() {\n }\n}",
);
expectPrinted_(
"class Foo { static get #foo() {} }",
- "class Foo {\n static get #foo() {\n }\n}"
+ "class Foo {\n static get #foo() {\n }\n}",
);
expectPrinted_(
"class Foo { static set #foo(x) {} }",
- "class Foo {\n static set #foo(x) {\n }\n}"
+ "class Foo {\n static set #foo(x) {\n }\n}",
);
expectParseError(
"class Foo { #foo = #foo in #bar in this; #bar }",
- "Unexpected #bar"
+ "Unexpected #bar",
);
expectParseError(
"class Foo { #constructor }",
- 'Invalid field name "#constructor"'
+ 'Invalid field name "#constructor"',
);
expectParseError(
"class Foo { #constructor() {} }",
- 'Invalid method name "#constructor"'
+ 'Invalid method name "#constructor"',
);
expectParseError(
"class Foo { static #constructor }",
- 'Invalid field name "#constructor"'
+ 'Invalid field name "#constructor"',
);
expectParseError(
"class Foo { static #constructor() {} }",
- 'Invalid method name "#constructor"'
+ 'Invalid method name "#constructor"',
);
expectParseError(
"class Foo { #\\u0063onstructor }",
- 'Invalid field name "#constructor"'
+ 'Invalid field name "#constructor"',
);
expectParseError(
"class Foo { #\\u0063onstructor() {} }",
- 'Invalid method name "#constructor"'
+ 'Invalid method name "#constructor"',
);
expectParseError(
"class Foo { static #\\u0063onstructor }",
- 'Invalid field name "#constructor"'
+ 'Invalid field name "#constructor"',
);
expectParseError(
"class Foo { static #\\u0063onstructor() {} }",
- 'Invalid method name "#constructor"'
+ 'Invalid method name "#constructor"',
);
const errorText = '"#foo" has already been declared';
expectParseError("class Foo { #foo; #foo }", errorText);
@@ -1350,44 +1350,44 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectParseError("class Foo { set #foo(x) {} set #foo(x) {} }", errorText);
expectParseError(
"class Foo { get #foo() {} set #foo(x) {} #foo }",
- errorText
+ errorText,
);
expectParseError(
"class Foo { set #foo(x) {} get #foo() {} #foo }",
- errorText
+ errorText,
);
expectPrinted_(
"class Foo { get #foo() {} set #foo(x) { this.#foo } }",
- "class Foo {\n get #foo() {\n }\n set #foo(x) {\n this.#foo;\n }\n}"
+ "class Foo {\n get #foo() {\n }\n set #foo(x) {\n this.#foo;\n }\n}",
);
expectPrinted_(
"class Foo { set #foo(x) { this.#foo } get #foo() {} }",
- "class Foo {\n set #foo(x) {\n this.#foo;\n }\n get #foo() {\n }\n}"
+ "class Foo {\n set #foo(x) {\n this.#foo;\n }\n get #foo() {\n }\n}",
);
expectPrinted_(
"class Foo { #foo } class Bar { #foo }",
- "class Foo {\n #foo;\n}\n\nclass Bar {\n #foo;\n}"
+ "class Foo {\n #foo;\n}\n\nclass Bar {\n #foo;\n}",
);
expectPrinted_(
"class Foo { foo = this.#foo; #foo }",
- "class Foo {\n foo = this.#foo;\n #foo;\n}"
+ "class Foo {\n foo = this.#foo;\n #foo;\n}",
);
expectPrinted_(
"class Foo { foo = this?.#foo; #foo }",
- "class Foo {\n foo = this?.#foo;\n #foo;\n}"
+ "class Foo {\n foo = this?.#foo;\n #foo;\n}",
);
expectParseError(
"class Foo { #foo } class Bar { foo = this.#foo }",
- 'Private name "#foo" must be declared in an enclosing class'
+ 'Private name "#foo" must be declared in an enclosing class',
);
expectParseError(
"class Foo { #foo } class Bar { foo = this?.#foo }",
- 'Private name "#foo" must be declared in an enclosing class'
+ 'Private name "#foo" must be declared in an enclosing class',
);
expectParseError(
"class Foo { #foo } class Bar { foo = #foo in this }",
- 'Private name "#foo" must be declared in an enclosing class'
+ 'Private name "#foo" must be declared in an enclosing class',
);
expectPrinted_(
@@ -1421,7 +1421,7 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
}
};
}
-}`
+}`,
);
});
@@ -1434,63 +1434,63 @@ export var ComponentThatHasSpreadCausesDeopt = jsx(Hello, {
expectPrinted_("export type {default} from 'bar'", "");
expectPrinted_(
"export { type } from 'mod'; type",
- 'export { type } from "mod";\ntype'
+ 'export { type } from "mod";\ntype',
);
expectPrinted_(
"export { type, as } from 'mod'",
- 'export { type, as } from "mod"'
+ 'export { type, as } from "mod"',
);
expectPrinted_(
"export { x, type foo } from 'mod'; x",
- 'export { x } from "mod";\nx'
+ 'export { x } from "mod";\nx',
);
expectPrinted_(
"export { x, type as } from 'mod'; x",
- 'export { x } from "mod";\nx'
+ 'export { x } from "mod";\nx',
);
expectPrinted_(
"export { x, type foo as bar } from 'mod'; x",
- 'export { x } from "mod";\nx'
+ 'export { x } from "mod";\nx',
);
expectPrinted_(
"export { x, type foo as as } from 'mod'; x",
- 'export { x } from "mod";\nx'
+ 'export { x } from "mod";\nx',
);
expectPrinted_(
"export { type as as } from 'mod'; as",
- 'export { type as as } from "mod";\nas'
+ 'export { type as as } from "mod";\nas',
);
expectPrinted_(
"export { type as foo } from 'mod'; foo",
- 'export { type as foo } from "mod";\nfoo'
+ 'export { type as foo } from "mod";\nfoo',
);
expectPrinted_(
"export { type as type } from 'mod'; type",
- 'export { type } from "mod";\ntype'
+ 'export { type } from "mod";\ntype',
);
expectPrinted_(
"export { x, type as as foo } from 'mod'; x",
- 'export { x } from "mod";\nx'
+ 'export { x } from "mod";\nx',
);
expectPrinted_(
"export { x, type as as as } from 'mod'; x",
- 'export { x } from "mod";\nx'
+ 'export { x } from "mod";\nx',
);
expectPrinted_(
"export { x, type type as as } from 'mod'; x",
- 'export { x } from "mod";\nx'
+ 'export { x } from "mod";\nx',
);
expectPrinted_(
"export { x, \\u0074ype y }; let x, y",
- "export { x };\nlet x, y"
+ "export { x };\nlet x, y",
);
expectPrinted_(
"export { x, \\u0074ype y } from 'mod'",
- 'export { x } from "mod"'
+ 'export { x } from "mod"',
);
expectPrinted_(
"export { x, type if } from 'mod'",
- 'export { x } from "mod"'
+ 'export { x } from "mod"',
);
expectPrinted_("export { x, type y as if }; let x", "export { x };\nlet x");
expectPrinted_("export { type x };", "");
@@ -1519,78 +1519,78 @@ class Foo {
}
bar;
}
-`.trim()
+`.trim(),
);
});
it("class static blocks", () => {
expectPrinted_(
"class Foo { static {} }",
- "class Foo {\n static {\n }\n}"
+ "class Foo {\n static {\n }\n}",
);
expectPrinted_(
"class Foo { static {} x = 1 }",
- "class Foo {\n static {\n }\n x = 1;\n}"
+ "class Foo {\n static {\n }\n x = 1;\n}",
);
expectPrinted_(
"class Foo { static { this.foo() } }",
- "class Foo {\n static {\n this.foo();\n }\n}"
+ "class Foo {\n static {\n this.foo();\n }\n}",
);
expectParseError(
"class Foo { static { yield } }",
- '"yield" is a reserved word and cannot be used in strict mode'
+ '"yield" is a reserved word and cannot be used in strict mode',
);
expectParseError(
"class Foo { static { await } }",
- 'The keyword "await" cannot be used here'
+ 'The keyword "await" cannot be used here',
);
expectParseError(
"class Foo { static { return } }",
- "A return statement cannot be used here"
+ "A return statement cannot be used here",
);
expectParseError(
"class Foo { static { break } }",
- 'Cannot use "break" here'
+ 'Cannot use "break" here',
);
expectParseError(
"class Foo { static { continue } }",
- 'Cannot use "continue" here'
+ 'Cannot use "continue" here',
);
expectParseError(
"x: { class Foo { static { break x } } }",
- 'There is no containing label named "x"'
+ 'There is no containing label named "x"',
);
expectParseError(
"x: { class Foo { static { continue x } } }",
- 'There is no containing label named "x"'
+ 'There is no containing label named "x"',
);
expectParseError(
"class Foo { get #x() { this.#x = 1 } }",
- 'Writing to getter-only property "#x" will throw'
+ 'Writing to getter-only property "#x" will throw',
);
expectParseError(
"class Foo { get #x() { this.#x += 1 } }",
- 'Writing to getter-only property "#x" will throw'
+ 'Writing to getter-only property "#x" will throw',
);
expectParseError(
"class Foo { set #x(x) { this.#x } }",
- 'Reading from setter-only property "#x" will throw'
+ 'Reading from setter-only property "#x" will throw',
);
expectParseError(
"class Foo { set #x(x) { this.#x += 1 } }",
- 'Reading from setter-only property "#x" will throw'
+ 'Reading from setter-only property "#x" will throw',
);
// Writing to method warnings
expectParseError(
"class Foo { #x() { this.#x = 1 } }",
- 'Writing to read-only method "#x" will throw'
+ 'Writing to read-only method "#x" will throw',
);
expectParseError(
"class Foo { #x() { this.#x += 1 } }",
- 'Writing to read-only method "#x" will throw'
+ 'Writing to read-only method "#x" will throw',
);
});
diff --git a/test/bun.js/tsconfig.json b/test/bun.js/tsconfig.json
index 975c49fe4..4763c09e6 100644
--- a/test/bun.js/tsconfig.json
+++ b/test/bun.js/tsconfig.json
@@ -1,15 +1,16 @@
{
+ "extends": "../../tsconfig.base.json",
"compilerOptions": {
- "lib": ["ESNext"],
- "module": "esnext",
- "target": "esnext",
- "noEmit": true,
- "allowJs": true,
- "types": ["bun-types"],
"allowSyntheticDefaultImports": true,
- "baseUrl": ".",
"paths": {
- "foo/bar": ["baz.js"]
- }
- }
-}
+ "foo/bar": [
+ "baz.js"
+ ]
+ },
+ "baseUrl": "."
+ },
+ "exclude": [
+ "solid-dom-fixtures",
+ "bundled"
+ ]
+} \ No newline at end of file
diff --git a/test/bun.js/url.test.ts b/test/bun.js/url.test.ts
index 87291a09c..f7ad84752 100644
--- a/test/bun.js/url.test.ts
+++ b/test/bun.js/url.test.ts
@@ -3,38 +3,21 @@ import { describe, it, expect } from "bun:test";
describe("url", () => {
it("prints", () => {
expect(Bun.inspect(new URL("https://example.com"))).toBe(
- "https://example.com/"
+ "https://example.com/",
);
expect(
Bun.inspect(
new URL(
- "https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night"
- )
- )
+ "https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night",
+ ),
+ ),
).toBe(
- "https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night"
+ "https://github.com/oven-sh/bun/issues/135?hello%20i%20have%20spaces%20thank%20you%20good%20night",
);
});
it("works", () => {
- const inputs: [
- [
- string,
- {
- hash: string;
- host: string;
- hostname: string;
- href: string;
- origin: string;
- password: string;
- pathname: string;
- port: string;
- protocol: string;
- search: string;
- username: string;
- }
- ]
- ] = [
+ const inputs = [
[
"https://username:password@api.foo.bar.com:9999/baz/okay/i/123?ran=out&of=things#to-use-as-a-placeholder",
{
@@ -83,7 +66,7 @@ describe("url", () => {
username: "",
},
],
- ];
+ ] as const;
for (let [url, values] of inputs) {
const result = new URL(url);
diff --git a/test/bun.js/util/util-promisify.test.js b/test/bun.js/util/util-promisify.test.js
index 251de0cc6..067751321 100644
--- a/test/bun.js/util/util-promisify.test.js
+++ b/test/bun.js/util/util-promisify.test.js
@@ -21,10 +21,10 @@
// Tests adapted from https://github.com/nodejs/node/blob/main/test/parallel/test-util-promisify.js
import { describe, it } from "bun:test";
-import fs from 'node:fs';
+import fs from "node:fs";
// TODO: vm module not implemented by bun yet
// import vm from 'node:vm';
-import { promisify } from 'util';
+import { promisify } from "util";
import assert from "assert";
const stat = promisify(fs.stat);
@@ -34,10 +34,10 @@ function invalidArgTypeHelper(input) {
if (input == null) {
return ` Received ${input}`;
}
- if (typeof input === 'function' && input.name) {
+ if (typeof input === "function" && input.name) {
return ` Received function ${input.name}`;
}
- if (typeof input === 'object') {
+ if (typeof input === "object") {
if (input.constructor?.name) {
return ` Received an instance of ${input.constructor.name}`;
}
@@ -45,7 +45,9 @@ function invalidArgTypeHelper(input) {
}
let inspected = inspect(input, { colors: false });
- if (inspected.length > 28) { inspected = `${inspected.slice(inspected, 0, 25)}...`; }
+ if (inspected.length > 28) {
+ inspected = `${inspected.slice(inspected, 0, 25)}...`;
+ }
return ` Received type ${typeof input} (${inspected})`;
}
@@ -57,18 +59,23 @@ describe("util.promisify", () => {
it.skip("all cases", () => {
const promise = stat(__filename);
assert.equal(promise instanceof Promise, true);
- promise.then(common.mustCall((value) => {
- assert.deepStrictEqual(value, fs.statSync(__filename));
- }));
-
-
- const promiseFileDontExist = stat('/dontexist');
- promiseFileDontExist.catch(common.mustCall((error) => {
- assert(error.message.includes('ENOENT: no such file or directory, stat'));
- }));
- })
- })
-
+ promise.then(
+ common.mustCall((value) => {
+ assert.deepStrictEqual(value, fs.statSync(__filename));
+ }),
+ );
+
+ const promiseFileDontExist = stat("/dontexist");
+ promiseFileDontExist.catch(
+ common.mustCall((error) => {
+ assert(
+ error.message.includes("ENOENT: no such file or directory, stat"),
+ );
+ }),
+ );
+ });
+ });
+
describe("promisify.custom", () => {
it("double promisify", () => {
function fn() {}
@@ -77,7 +84,7 @@ describe("util.promisify", () => {
fn[promisify.custom] = promisifedFn;
assert.strictEqual(promisify(fn), promisifedFn);
assert.strictEqual(promisify(promisify(fn)), promisifedFn);
- })
+ });
it.skip("should register shared promisify symbol", () => {
function fn() {}
@@ -87,14 +94,16 @@ describe("util.promisify", () => {
// TODO: register shared symbol promisify.custom
// util.promisify.custom is a shared symbol which can be accessed
// as `Symbol.for("nodejs.util.promisify.custom")`.
- const kCustomPromisifiedSymbol = Symbol.for('nodejs.util.promisify.custom');
+ const kCustomPromisifiedSymbol = Symbol.for(
+ "nodejs.util.promisify.custom",
+ );
fn[kCustomPromisifiedSymbol] = promisifiedFn;
assert.strictEqual(kCustomPromisifiedSymbol, promisify.custom);
assert.strictEqual(promisify(fn), promisifiedFn);
assert.strictEqual(promisify(promisify(fn)), promisifiedFn);
- })
- })
+ });
+ });
it("should fail when type is not a function", () => {
function fn() {}
@@ -103,28 +112,28 @@ describe("util.promisify", () => {
() => promisify(fn),
// TODO: error code is not the same as node's.
// { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError' }
- { name: 'TypeError' }
+ { name: "TypeError" },
);
- })
-
+ });
+
it("should call custom promised promised function with proper args", () => {
const firstValue = 5;
const secondValue = 17;
var called = false;
function fn(callback) {
- called = true
+ called = true;
callback(null, firstValue, secondValue);
}
- fn[Symbol('customPromisifyArgs')] = ['first', 'second'];
+ fn[Symbol("customPromisifyArgs")] = ["first", "second"];
promisify(fn)().then((firstValue, secondValue) => {
assert.strictEqual(called, true);
assert.strictEqual(firstValue, 5);
assert.strictEqual(secondValue, 17);
});
- })
+ });
// TODO: unable to test since vm module not implemented
// it("should run in new vm context", () => {
@@ -133,17 +142,17 @@ describe("util.promisify", () => {
// });
describe("callback cases", () => {
- it('should run basic callback', async () => {
+ it("should run basic callback", async () => {
var called = false;
function fn(callback) {
called = true;
- callback(null, 'foo', 'bar');
+ callback(null, "foo", "bar");
}
await promisify(fn)().then((value) => {
- assert.strictEqual(value, 'foo');
+ assert.strictEqual(value, "foo");
assert.strictEqual(called, true);
});
- })
+ });
it("should not require value to be returned in callback", async () => {
var called = false;
@@ -155,7 +164,7 @@ describe("util.promisify", () => {
assert.strictEqual(value, undefined);
assert.strictEqual(called, true);
});
- })
+ });
it("should not require error to be passed", async () => {
var called = false;
@@ -167,7 +176,7 @@ describe("util.promisify", () => {
assert.strictEqual(value, undefined);
assert.strictEqual(called, true);
});
- })
+ });
it("custom callback", async () => {
var called = false;
@@ -179,7 +188,7 @@ describe("util.promisify", () => {
assert.strictEqual(value, 42);
assert.strictEqual(called, true);
});
- })
+ });
it("should catch error", async () => {
var called = false;
@@ -187,12 +196,12 @@ describe("util.promisify", () => {
called = true;
callback(err, val);
}
- await promisify(fn)(new Error('oops'), null).catch(err => {
- assert.strictEqual(err.message, 'oops')
+ await promisify(fn)(new Error("oops"), null).catch((err) => {
+ assert.strictEqual(err.message, "oops");
assert.strictEqual(called, true);
});
- })
-
+ });
+
it("should call promisify properly inside async block", async () => {
var called = false;
function fn(err, val, callback) {
@@ -206,12 +215,12 @@ describe("util.promisify", () => {
})().then(() => {
assert.strictEqual(called, true);
});
- })
+ });
it("should not break this reference", async () => {
const o = {};
var called = false;
- const fn = promisify(function(cb) {
+ const fn = promisify(function (cb) {
called = true;
cb(null, this === o);
});
@@ -219,22 +228,24 @@ describe("util.promisify", () => {
o.fn = fn;
await o.fn().then((val) => {
- assert.strictEqual(called, true)
+ assert.strictEqual(called, true);
assert.strictEqual(val, true);
});
- })
+ });
- it("should not have called callback with error", async() => {
- const err = new Error('Should not have called the callback with the error.');
+ it("should not have called callback with error", async () => {
+ const err = new Error(
+ "Should not have called the callback with the error.",
+ );
const stack = err.stack;
var called = false;
-
- const fn = promisify(function(cb) {
+
+ const fn = promisify(function (cb) {
called = true;
cb(null);
cb(err);
});
-
+
await (async () => {
await fn();
await Promise.resolve();
@@ -242,58 +253,58 @@ describe("util.promisify", () => {
})().then(() => {
assert.strictEqual(called, true);
});
- })
-
- it('should compare promised objects properly', () => {
- function c() { }
- const a = promisify(function() { });
+ });
+
+ it("should compare promised objects properly", () => {
+ function c() {}
+ const a = promisify(function () {});
const b = promisify(a);
assert.notStrictEqual(c, a);
assert.strictEqual(a, b);
- })
+ });
it("should throw error", async () => {
let errToThrow;
- const thrower = promisify(function(a, b, c, cb) {
+ const thrower = promisify(function (a, b, c, cb) {
errToThrow = new Error();
throw errToThrow;
});
await thrower(1, 2, 3)
.then(assert.fail)
.then(assert.fail, (e) => assert.strictEqual(e, errToThrow));
- })
+ });
it("should also throw error inside Promise.all", async () => {
const err = new Error();
const a = promisify((cb) => cb(err))();
- const b = promisify(() => { throw err; })();
+ const b = promisify(() => {
+ throw err;
+ })();
await Promise.all([
- a.then(assert.fail, function(e) {
+ a.then(assert.fail, function (e) {
assert.strictEqual(err, e);
}),
- b.then(assert.fail, function(e) {
+ b.then(assert.fail, function (e) {
assert.strictEqual(err, e);
}),
]);
- })
- })
+ });
+ });
describe("invalid input", () => {
// This test is failing because 'code' property
// is not thrown in the error. does it have different
// throw error implementation in bun?
it("should throw on invalid inputs for promisify", () => {
- [undefined, null, true, 0, 'str', {}, [], Symbol()].forEach((input) => {
- assert.throws(
- () => promisify(input),
- {
- code: 'ERR_INVALID_ARG_TYPE',
- name: 'TypeError',
- message: 'The "original" argument must be of type Function'
- });
+ [undefined, null, true, 0, "str", {}, [], Symbol()].forEach((input) => {
+ assert.throws(() => promisify(input), {
+ code: "ERR_INVALID_ARG_TYPE",
+ name: "TypeError",
+ message: 'The "original" argument must be of type Function',
+ });
});
- })
- })
+ });
+ });
});
diff --git a/test/bun.js/util/util.test.js b/test/bun.js/util/util.test.js
index 15d3cd221..ded15a435 100644
--- a/test/bun.js/util/util.test.js
+++ b/test/bun.js/util/util.test.js
@@ -112,7 +112,7 @@ describe("util", () => {
strictEqual(util.isPrimitive(/regexp/), false);
strictEqual(
util.isPrimitive(function () {}),
- false
+ false,
);
strictEqual(util.isPrimitive(new Number(1)), false);
strictEqual(util.isPrimitive(new String("bla")), false);
@@ -210,11 +210,11 @@ describe("util", () => {
it("all cases", () => {
strictEqual(
util.isFunction(() => {}),
- true
+ true,
);
strictEqual(
util.isFunction(function () {}),
- true
+ true,
);
strictEqual(util.isFunction(), false);
strictEqual(util.isFunction("string"), false);
@@ -236,7 +236,7 @@ describe("util", () => {
strictEqual(util.types.isNativeError({}), false);
strictEqual(
util.types.isNativeError({ name: "Error", message: "" }),
- false
+ false,
);
strictEqual(util.types.isNativeError([]), false);
// strictEqual( // FIXME: failing test
@@ -263,7 +263,7 @@ describe("util", () => {
expect(util.TextEncoder === globalThis.TextEncoder).toBe(true);
});
});
-
+
describe("TextDecoder", () => {
// test/bun.js/text-decoder.test.js covers test cases for TextDecoder
// here we test only if we use the same via util.TextDecoder
diff --git a/test/bun.js/web-crypto.test.ts b/test/bun.js/web-crypto.test.ts
index 72730f8ff..19d068180 100644
--- a/test/bun.js/web-crypto.test.ts
+++ b/test/bun.js/web-crypto.test.ts
@@ -13,7 +13,7 @@ describe("Web Crypto", () => {
length: 256,
},
true,
- ["encrypt", "decrypt"]
+ ["encrypt", "decrypt"],
);
const iv = crypto.getRandomValues(new Uint8Array(12));
const data = new TextEncoder().encode("Hello World!");
@@ -23,7 +23,7 @@ describe("Web Crypto", () => {
iv,
},
key,
- data
+ data,
);
const decrypted = await crypto.subtle.decrypt(
{
@@ -31,7 +31,7 @@ describe("Web Crypto", () => {
iv,
},
key,
- encrypted
+ encrypted,
);
expect(new TextDecoder().decode(decrypted)).toBe("Hello World!");
});
@@ -43,7 +43,7 @@ describe("Web Crypto", () => {
new TextEncoder().encode(secret),
{ name: "HMAC", hash: "SHA-256" },
false,
- ["sign", "verify"]
+ ["sign", "verify"],
);
}
@@ -52,7 +52,7 @@ describe("Web Crypto", () => {
const signature = await crypto.subtle.sign(
"HMAC",
key,
- new TextEncoder().encode(message)
+ new TextEncoder().encode(message),
);
// Convert ArrayBuffer to Base64
@@ -69,7 +69,7 @@ describe("Web Crypto", () => {
"HMAC",
key,
sigBuf,
- new TextEncoder().encode(message)
+ new TextEncoder().encode(message),
);
}
diff --git a/test/bun.js/web-globals.test.js b/test/bun.js/web-globals.test.js
index afcded6db..2f966aa03 100644
--- a/test/bun.js/web-globals.test.js
+++ b/test/bun.js/web-globals.test.js
@@ -54,7 +54,7 @@ it("crypto.getRandomValues", () => {
var array = crypto.getRandomValues(foo);
expect(array).toBe(foo);
expect(array.reduce((sum, a) => (sum += a === 0), 0) != foo.length).toBe(
- true
+ true,
);
}
@@ -66,7 +66,7 @@ it("crypto.getRandomValues", () => {
// run it on a large input
expect(
- !!crypto.getRandomValues(new Uint8Array(8096)).find((a) => a > 0)
+ !!crypto.getRandomValues(new Uint8Array(8096)).find((a) => a > 0),
).toBe(true);
{
@@ -74,7 +74,7 @@ it("crypto.getRandomValues", () => {
var array = crypto.getRandomValues(foo, "unbuffered");
expect(array).toBe(foo);
expect(array.reduce((sum, a) => (sum += a === 0), 0) != foo.length).toBe(
- true
+ true,
);
}
});
diff --git a/test/bun.js/websocket-server.test.ts b/test/bun.js/websocket-server.test.ts
index 7c7869fad..dd88d6707 100644
--- a/test/bun.js/websocket-server.test.ts
+++ b/test/bun.js/websocket-server.test.ts
@@ -1,6 +1,6 @@
import { serve } from "bun";
import { describe, expect, it } from "bun:test";
-import { gcTick } from "gc";
+import { gcTick } from "./gc";
var port = 4321;
function getPort() {
@@ -25,7 +25,7 @@ describe("websocket server", () => {
close(ws) {
ws[method](
"all",
- method === "publishBinary" ? Buffer.from("bye!") : "bye!"
+ method === "publishBinary" ? Buffer.from("bye!") : "bye!",
);
},
},
@@ -39,16 +39,16 @@ describe("websocket server", () => {
});
try {
- const first = await new Promise((resolve2, reject2) => {
+ const first = await new Promise<WebSocket>((resolve2, reject2) => {
var socket = new WebSocket(
- `ws://${server.hostname}:${server.port}`
+ `ws://${server.hostname}:${server.port}`,
);
socket.onopen = () => resolve2(socket);
});
- const second = await new Promise((resolve2, reject2) => {
+ const second = await new Promise<WebSocket>((resolve2, reject2) => {
var socket = new WebSocket(
- `ws://${server.hostname}:${server.port}`
+ `ws://${server.hostname}:${server.port}`,
);
socket.onmessage = (ev) => {
var msg = ev.data;
@@ -107,7 +107,7 @@ describe("websocket server", () => {
},
});
- await new Promise((resolve_, reject) => {
+ await new Promise<void>((resolve_, reject) => {
resolve = resolve_;
const websocket = new WebSocket(`ws://${server.hostname}:${server.port}`);
websocket.onopen = () => {
@@ -138,8 +138,7 @@ describe("websocket server", () => {
if (
server.upgrade(req, {
data: "hello world",
-
- headers: 1238,
+ headers: 1238 as any,
})
) {
reject();
@@ -155,7 +154,7 @@ describe("websocket server", () => {
},
});
- await new Promise((resolve_, reject) => {
+ await new Promise<void>((resolve_, reject) => {
resolve = resolve_;
const websocket = new WebSocket(`ws://${server.hostname}:${server.port}`);
websocket.onopen = () => websocket.close();
@@ -194,7 +193,7 @@ describe("websocket server", () => {
},
});
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
const websocket = new WebSocket(`ws://${server.hostname}:${server.port}`);
websocket.onopen = () => {
websocket.send("hello world");
@@ -253,7 +252,7 @@ describe("websocket server", () => {
},
});
- return new Promise((resolve, reject) => {
+ return new Promise<void>((resolve, reject) => {
const websocket = new WebSocket(`ws://${server.hostname}:${server.port}`);
websocket.onopen = () => {
websocket.send("hello world");
@@ -312,7 +311,7 @@ describe("websocket server", () => {
return new Response("noooooo hello world");
},
});
- return new Promise((resolve, reject) => {
+ return new Promise<void>((resolve, reject) => {
const websocket = new WebSocket(`ws://${server.hostname}:${server.port}`);
websocket.onopen = () => {
websocket.send("hello world");
@@ -367,7 +366,7 @@ describe("websocket server", () => {
},
});
- await new Promise((resolve, reject) => {
+ await new Promise<boolean>((resolve, reject) => {
var counter = 0;
const websocket = new WebSocket(`ws://${server.hostname}:${server.port}`);
websocket.onopen = () => {
@@ -399,7 +398,7 @@ describe("websocket server", () => {
});
it("does not upgrade for non-websocket connections", async () => {
- await new Promise(async (resolve, reject) => {
+ await new Promise<void>(async (resolve, reject) => {
var server = serve({
port: getPort(),
websocket: {
@@ -425,7 +424,7 @@ describe("websocket server", () => {
});
it("does not upgrade for non-websocket servers", async () => {
- await new Promise(async (resolve, reject) => {
+ await new Promise<void>(async (resolve, reject) => {
var server = serve({
port: getPort(),
@@ -465,7 +464,7 @@ describe("websocket server", () => {
},
});
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
const websocket = new WebSocket(`ws://${server.hostname}:${server.port}`);
websocket.onmessage = (e) => {
@@ -487,7 +486,7 @@ describe("websocket server", () => {
});
it("publishText()", async () => {
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
var server = serve({
port: getPort(),
websocket: {
@@ -515,7 +514,7 @@ describe("websocket server", () => {
it("publishBinary()", async () => {
const bytes = Buffer.from("hello");
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
var server = serve({
port: getPort(),
websocket: {
@@ -542,7 +541,7 @@ describe("websocket server", () => {
});
it("sendText()", async () => {
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
var server = serve({
port: getPort(),
websocket: {
@@ -570,7 +569,7 @@ describe("websocket server", () => {
it("sendBinary()", async () => {
const bytes = Buffer.from("hello");
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
var server = serve({
port: getPort(),
websocket: {
@@ -616,7 +615,7 @@ describe("websocket server", () => {
},
});
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
const websocket = new WebSocket(`ws://${server.hostname}:${server.port}`);
websocket.onmessage = (e) => {
@@ -654,14 +653,14 @@ describe("websocket server", () => {
fetch(req, server) {
if (
server.upgrade(req, {
- count: 0,
+ data: { count: 0 },
})
)
return new Response("noooooo hello world");
},
});
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
const websocket = new WebSocket(`ws://${server.hostname}:${server.port}`);
websocket.onerror = (e) => {
reject(e);
@@ -708,7 +707,7 @@ describe("websocket server", () => {
it("send rope strings", async () => {
var ropey = "hello world".repeat(10);
- var sendQueue = [];
+ var sendQueue: any[] = [];
for (var i = 0; i < 100; i++) {
sendQueue.push(ropey + " " + i);
}
@@ -737,7 +736,7 @@ describe("websocket server", () => {
},
});
- await new Promise((resolve, reject) => {
+ await new Promise<void>((resolve, reject) => {
const websocket = new WebSocket(`ws://${server.hostname}:${server.port}`);
websocket.onerror = (e) => {
reject(e);
@@ -771,7 +770,7 @@ describe("websocket server", () => {
// this test sends 100 messages to 10 connected clients via pubsub
it("pub/sub", async () => {
var ropey = "hello world".repeat(10);
- var sendQueue = [];
+ var sendQueue: any[] = [];
for (var i = 0; i < 100; i++) {
sendQueue.push(ropey + " " + i);
gcTick();
@@ -817,7 +816,7 @@ describe("websocket server", () => {
const connections = new Array(10);
const websockets = new Array(connections.length);
var doneCounter = 0;
- await new Promise((done) => {
+ await new Promise<void>((done) => {
for (var i = 0; i < connections.length; i++) {
var j = i;
var resolve, reject, resolveConnection, rejectConnection;
@@ -831,7 +830,7 @@ describe("websocket server", () => {
});
gcTick();
const websocket = new WebSocket(
- `ws://${server.hostname}:${server.port}`
+ `ws://${server.hostname}:${server.port}`,
);
websocket.onerror = (e) => {
reject(e);
diff --git a/test/bun.js/which.test.ts b/test/bun.js/which.test.ts
index 7fd4b8400..150bfa767 100644
--- a/test/bun.js/which.test.ts
+++ b/test/bun.js/which.test.ts
@@ -15,27 +15,27 @@ test("which", () => {
// You can override PATH
which("myscript.sh", {
PATH: "/tmp",
- })
+ }),
).toBe("/tmp/myscript.sh");
expect(
which("myscript.sh", {
PATH: "/not-tmp",
- })
+ }),
).toBe(null);
expect(
// PATH works like the $PATH environment variable, respecting colons
which("myscript.sh", {
PATH: "/not-tmp:/tmp",
- })
+ }),
).toBe("/tmp/myscript.sh");
expect(
// cwd is checked first
which("myscript.sh", {
cwd: "/tmp",
- })
+ }),
).toBe("/tmp/myscript.sh");
});