Fix Node browser fallbacks to have util.inherit and other size improvements (#19783)

Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2025-05-20 23:25:52 -07:00
committed by GitHub
parent 98ee30eccf
commit 8aae534270
31 changed files with 5195 additions and 922 deletions

View File

@@ -17,6 +17,7 @@ src/node-fallbacks/stream.js
src/node-fallbacks/string_decoder.js
src/node-fallbacks/sys.js
src/node-fallbacks/timers.js
src/node-fallbacks/timers.promises.js
src/node-fallbacks/tty.js
src/node-fallbacks/url.js
src/node-fallbacks/util.js

View File

@@ -161,14 +161,9 @@ register_command(
CWD
${BUN_NODE_FALLBACKS_SOURCE}
COMMAND
${BUN_EXECUTABLE} x
esbuild ${ESBUILD_ARGS}
${BUN_EXECUTABLE} run build-fallbacks
${BUN_NODE_FALLBACKS_OUTPUT}
${BUN_NODE_FALLBACKS_SOURCES}
--outdir=${BUN_NODE_FALLBACKS_OUTPUT}
--format=esm
--minify
--bundle
--platform=browser
SOURCES
${BUN_NODE_FALLBACKS_SOURCES}
${BUN_NODE_FALLBACKS_NODE_MODULES}

View File

@@ -1,6 +1,24 @@
/**
* Browser polyfill for the `"assert"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export * from "assert";
import assert_module from "assert";
export const AssertionError = assert_module.AssertionError;
export const CallTracker = assert_module.CallTracker;
export const deepEqual = assert_module.deepEqual;
export const deepStrictEqual = assert_module.deepStrictEqual;
export const doesNotMatch = assert_module.doesNotMatch;
export const doesNotReject = assert_module.doesNotReject;
export const doesNotThrow = assert_module.doesNotThrow;
export const equal = assert_module.equal;
export const fail = assert_module.fail;
export const ifError = assert_module.ifError;
export const match = assert_module.match;
export const notDeepEqual = assert_module.notDeepEqual;
export const notDeepStrictEqual = assert_module.notDeepStrictEqual;
export const notEqual = assert_module.notEqual;
export const notStrictEqual = assert_module.notStrictEqual;
export const ok = assert_module.ok;
export const rejects = assert_module.rejects;
export const strict = assert_module.strict;
export const strictEqual = assert_module.strictEqual;
export const throws = assert_module.throws;
export * as default from "assert";

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,60 @@
import * as fs from "fs";
import * as Module from "module";
import { basename, extname } from "path";
const allFiles = fs.readdirSync(".").filter(f => f.endsWith(".js"));
const outdir = process.argv[2];
const builtins = Module.builtinModules;
let commands = [];
let moduleFiles = [];
for (const name of allFiles) {
const mod = basename(name, extname(name)).replaceAll(".", "/");
const file = allFiles.find(f => f.startsWith(mod));
moduleFiles.push(file);
}
for (let fileIndex = 0; fileIndex < allFiles.length; fileIndex++) {
const name = allFiles[fileIndex];
const mod = basename(name, extname(name)).replaceAll(".", "/");
const file = allFiles.find(f => f.startsWith(mod));
const externals = [...builtins];
const i = externals.indexOf(name);
if (i !== -1) {
externals.splice(i, 1);
}
// Build all files at once with specific options
const externalModules = builtins
.concat(moduleFiles.filter(f => f !== name))
.flatMap(b => [`--external:node:${b}`, `--external:${b}`])
.join(" ");
console.log(`bun build ${file} --minify-syntax ${externalModules}`);
// Create the build command with all the specified options
const buildCommand =
Bun.$`bun build --outdir=${outdir} ${name} --minify-syntax --format=esm --target=node ${{ raw: externalModules }}`.text();
commands.push(
buildCommand.then(async text => {
// This is very brittle. But that should be okay for our usecase
let outfile = (await Bun.file(`${outdir}/${name}`).text())
.replaceAll("__require(", "require(")
.replace(/var __require.*$/gim, "")
.replaceAll("global.process", "require('process')")
.trim();
while (outfile.startsWith("import {")) {
outfile = outfile.slice(outfile.indexOf(";\n") + 1);
}
if (text.includes("import ")) {
throw new Error("Unexpected import in " + name);
}
await Bun.write(`${outdir}/${name}`, outfile);
}),
);
}
await Promise.all(commands);

View File

@@ -4,47 +4,98 @@
"": {
"name": "fallbacks",
"dependencies": {
"assert": "^2.0.0",
"assert": "^2.1.0",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
"console-browserify": "^1.2.0",
"constants-browserify": "^1.0.0",
"crypto-browserify": "^3.12.0",
"domain-browser": "^4.22.0",
"esbuild": "^0.14.10",
"crypto-browserify": "^3.12.1",
"domain-browser": "^4.23.0",
"esbuild": "^0.25.4",
"events": "^3.3.0",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"punycode": "^2.1.1",
"punycode": "^2.3.1",
"querystring-es3": "^1.0.0-0",
"react-refresh": "^0.16.0",
"readable-stream": "^4.1.0",
"react-refresh": "0.17.0",
"readable-stream": "^4.5.2",
"stream-http": "^3.2.0",
"string_decoder": "^1.3.0",
"timers-browserify": "^2.0.12",
"tty-browserify": "^0.0.1",
"url": "^0.11.0",
"util": "^0.12.4",
"url": "^0.11.4",
"util": "^0.12.5",
"vm-browserify": "^1.1.2",
},
},
},
"overrides": {
"readable-stream": "^4.5.2",
},
"packages": {
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.14.54", "", { "os":"linux", "cpu":"none" }, "sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw=="],
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.25.4", "", { "os": "aix", "cpu": "ppc64" }, "sha512-1VCICWypeQKhVbE9oW/sJaAmjLxhVqacdkvPLEjwlttjfwENRSClS8EjBz0KzRyFSCPDIkuXW34Je/vk7zdB7Q=="],
"@esbuild/android-arm": ["@esbuild/android-arm@0.25.4", "", { "os": "android", "cpu": "arm" }, "sha512-QNdQEps7DfFwE3hXiU4BZeOV68HHzYwGd0Nthhd3uCkkEKK7/R6MTgM0P7H7FAs5pU/DIWsviMmEGxEoxIZ+ZQ=="],
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.25.4", "", { "os": "android", "cpu": "arm64" }, "sha512-bBy69pgfhMGtCnwpC/x5QhfxAz/cBgQ9enbtwjf6V9lnPI/hMyT9iWpR1arm0l3kttTr4L0KSLpKmLp/ilKS9A=="],
"@esbuild/android-x64": ["@esbuild/android-x64@0.25.4", "", { "os": "android", "cpu": "x64" }, "sha512-TVhdVtQIFuVpIIR282btcGC2oGQoSfZfmBdTip2anCaVYcqWlZXGcdcKIUklfX2wj0JklNYgz39OBqh2cqXvcQ=="],
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.25.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Y1giCfM4nlHDWEfSckMzeWNdQS31BQGs9/rouw6Ub91tkK79aIMTH3q9xHvzH8d0wDru5Ci0kWB8b3up/nl16g=="],
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.25.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-CJsry8ZGM5VFVeyUYB3cdKpd/H69PYez4eJh1W/t38vzutdjEjtP7hB6eLKBoOdxcAlCtEYHzQ/PJ/oU9I4u0A=="],
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.25.4", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-yYq+39NlTRzU2XmoPW4l5Ifpl9fqSk0nAJYM/V/WUGPEFfek1epLHJIkTQM6bBs1swApjO5nWgvr843g6TjxuQ=="],
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.25.4", "", { "os": "freebsd", "cpu": "x64" }, "sha512-0FgvOJ6UUMflsHSPLzdfDnnBBVoCDtBTVyn/MrWloUNvq/5SFmh13l3dvgRPkDihRxb77Y17MbqbCAa2strMQQ=="],
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.25.4", "", { "os": "linux", "cpu": "arm" }, "sha512-kro4c0P85GMfFYqW4TWOpvmF8rFShbWGnrLqlzp4X1TNWjRY3JMYUfDCtOxPKOIY8B0WC8HN51hGP4I4hz4AaQ=="],
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.25.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-+89UsQTfXdmjIvZS6nUnOOLoXnkUTB9hR5QAeLrQdzOSWZvNSAXAtcRDHWtqAUtAmv7ZM1WPOOeSxDzzzMogiQ=="],
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.25.4", "", { "os": "linux", "cpu": "ia32" }, "sha512-yTEjoapy8UP3rv8dB0ip3AfMpRbyhSN3+hY8mo/i4QXFeDxmiYbEKp3ZRjBKcOP862Ua4b1PDfwlvbuwY7hIGQ=="],
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.25.4", "", { "os": "linux", "cpu": "none" }, "sha512-NeqqYkrcGzFwi6CGRGNMOjWGGSYOpqwCjS9fvaUlX5s3zwOtn1qwg1s2iE2svBe4Q/YOG1q6875lcAoQK/F4VA=="],
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.25.4", "", { "os": "linux", "cpu": "none" }, "sha512-IcvTlF9dtLrfL/M8WgNI/qJYBENP3ekgsHbYUIzEzq5XJzzVEV/fXY9WFPfEEXmu3ck2qJP8LG/p3Q8f7Zc2Xg=="],
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.25.4", "", { "os": "linux", "cpu": "ppc64" }, "sha512-HOy0aLTJTVtoTeGZh4HSXaO6M95qu4k5lJcH4gxv56iaycfz1S8GO/5Jh6X4Y1YiI0h7cRyLi+HixMR+88swag=="],
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.25.4", "", { "os": "linux", "cpu": "none" }, "sha512-i8JUDAufpz9jOzo4yIShCTcXzS07vEgWzyX3NH2G7LEFVgrLEhjwL3ajFE4fZI3I4ZgiM7JH3GQ7ReObROvSUA=="],
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.25.4", "", { "os": "linux", "cpu": "s390x" }, "sha512-jFnu+6UbLlzIjPQpWCNh5QtrcNfMLjgIavnwPQAfoGx4q17ocOU9MsQ2QVvFxwQoWpZT8DvTLooTvmOQXkO51g=="],
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.25.4", "", { "os": "linux", "cpu": "x64" }, "sha512-6e0cvXwzOnVWJHq+mskP8DNSrKBr1bULBvnFLpc1KY+d+irZSgZ02TGse5FsafKS5jg2e4pbvK6TPXaF/A6+CA=="],
"@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.25.4", "", { "os": "none", "cpu": "arm64" }, "sha512-vUnkBYxZW4hL/ie91hSqaSNjulOnYXE1VSLusnvHg2u3jewJBz3YzB9+oCw8DABeVqZGg94t9tyZFoHma8gWZQ=="],
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.25.4", "", { "os": "none", "cpu": "x64" }, "sha512-XAg8pIQn5CzhOB8odIcAm42QsOfa98SBeKUdo4xa8OvX8LbMZqEtgeWE9P/Wxt7MlG2QqvjGths+nq48TrUiKw=="],
"@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.25.4", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-Ct2WcFEANlFDtp1nVAXSNBPDxyU+j7+tId//iHXU2f/lN5AmO4zLyhDcpR5Cz1r08mVxzt3Jpyt4PmXQ1O6+7A=="],
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.25.4", "", { "os": "openbsd", "cpu": "x64" }, "sha512-xAGGhyOQ9Otm1Xu8NT1ifGLnA6M3sJxZ6ixylb+vIUVzvvd6GOALpwQrYrtlPouMqd/vSbgehz6HaVk4+7Afhw=="],
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.25.4", "", { "os": "sunos", "cpu": "x64" }, "sha512-Mw+tzy4pp6wZEK0+Lwr76pWLjrtjmJyUB23tHKqEDP74R3q95luY/bXqXZeYl4NYlvwOqoRKlInQialgCKy67Q=="],
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.25.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-AVUP428VQTSddguz9dO9ngb+E5aScyg7nOeJDrF1HPYu555gmza3bDGMPhmVXL8svDSoqPCsCPjb265yG/kLKQ=="],
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.25.4", "", { "os": "win32", "cpu": "ia32" }, "sha512-i1sW+1i+oWvQzSgfRcxxG2k4I9n3O9NRqy8U+uugaT2Dy7kLO9Y7wI72haOahxceMX8hZAzgGou1FhndRldxRg=="],
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.4", "", { "os": "win32", "cpu": "x64" }, "sha512-nOT2vZNw6hJ+z43oP1SPea/G/6AbN6X+bGNhNuq8NtRHy4wsMhw765IKLNmnjek7GvjWBYQ8Q5VBoYTFg9y1UQ=="],
"abort-controller": ["abort-controller@3.0.0", "", { "dependencies": { "event-target-shim": "^5.0.0" } }, "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg=="],
"asn1.js": ["asn1.js@5.4.1", "", { "dependencies": { "bn.js": "^4.0.0", "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "safer-buffer": "^2.1.0" } }, "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA=="],
"asn1.js": ["asn1.js@4.10.1", "", { "dependencies": { "bn.js": "^4.0.0", "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" } }, "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw=="],
"assert": ["assert@2.0.0", "", { "dependencies": { "es6-object-assign": "^1.1.0", "is-nan": "^1.2.1", "object-is": "^1.0.1", "util": "^0.12.0" } }, "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A=="],
"assert": ["assert@2.1.0", "", { "dependencies": { "call-bind": "^1.0.2", "is-nan": "^1.3.2", "object-is": "^1.1.5", "object.assign": "^4.1.4", "util": "^0.12.5" } }, "sha512-eLHpSK/Y4nhMJ07gDaAzoX/XAKS8PSaojml3M0DM4JpV1LAi5JOJ/p6H/XWrl8L+DzVEvVCW1z3vWAaB9oTsQw=="],
"available-typed-arrays": ["available-typed-arrays@1.0.5", "", {}, "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw=="],
"available-typed-arrays": ["available-typed-arrays@1.0.7", "", { "dependencies": { "possible-typed-array-names": "^1.0.0" } }, "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ=="],
"base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],
"bn.js": ["bn.js@5.2.1", "", {}, "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ=="],
"bn.js": ["bn.js@5.2.2", "", {}, "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw=="],
"brorand": ["brorand@1.1.0", "", {}, "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w=="],
@@ -54,9 +105,9 @@
"browserify-des": ["browserify-des@1.0.2", "", { "dependencies": { "cipher-base": "^1.0.1", "des.js": "^1.0.0", "inherits": "^2.0.1", "safe-buffer": "^5.1.2" } }, "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A=="],
"browserify-rsa": ["browserify-rsa@4.1.0", "", { "dependencies": { "bn.js": "^5.0.0", "randombytes": "^2.0.1" } }, "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog=="],
"browserify-rsa": ["browserify-rsa@4.1.1", "", { "dependencies": { "bn.js": "^5.2.1", "randombytes": "^2.1.0", "safe-buffer": "^5.2.1" } }, "sha512-YBjSAiTqM04ZVei6sXighu679a3SqWORA3qZTEqZImnlkDIFtKc6pNutpjyZ8RJTjQtuYfeetkxM11GwoYXMIQ=="],
"browserify-sign": ["browserify-sign@4.2.1", "", { "dependencies": { "bn.js": "^5.1.1", "browserify-rsa": "^4.0.1", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", "elliptic": "^6.5.3", "inherits": "^2.0.4", "parse-asn1": "^5.1.5", "readable-stream": "^3.6.0", "safe-buffer": "^5.2.0" } }, "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg=="],
"browserify-sign": ["browserify-sign@4.2.3", "", { "dependencies": { "bn.js": "^5.2.1", "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", "elliptic": "^6.5.5", "hash-base": "~3.0", "inherits": "^2.0.4", "parse-asn1": "^5.1.7", "readable-stream": "^2.3.8", "safe-buffer": "^5.2.1" } }, "sha512-JWCZW6SKhfhjJxO8Tyiiy+XYB7cqd2S5/+WeYHsKdNKFlCBhKbblba1A/HN/90YwtxKc8tCErjffZl++UNmGiw=="],
"browserify-zlib": ["browserify-zlib@0.2.0", "", { "dependencies": { "pako": "~1.0.5" } }, "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA=="],
@@ -66,9 +117,13 @@
"builtin-status-codes": ["builtin-status-codes@3.0.0", "", {}, "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ=="],
"call-bind": ["call-bind@1.0.2", "", { "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" } }, "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA=="],
"call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="],
"cipher-base": ["cipher-base@1.0.4", "", { "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" } }, "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q=="],
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
"call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
"cipher-base": ["cipher-base@1.0.6", "", { "dependencies": { "inherits": "^2.0.4", "safe-buffer": "^5.2.1" } }, "sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw=="],
"console-browserify": ["console-browserify@1.2.0", "", {}, "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA=="],
@@ -80,61 +135,29 @@
"create-hmac": ["create-hmac@1.1.7", "", { "dependencies": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", "inherits": "^2.0.1", "ripemd160": "^2.0.0", "safe-buffer": "^5.0.1", "sha.js": "^2.4.8" } }, "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg=="],
"crypto-browserify": ["crypto-browserify@3.12.0", "", { "dependencies": { "browserify-cipher": "^1.0.0", "browserify-sign": "^4.0.0", "create-ecdh": "^4.0.0", "create-hash": "^1.1.0", "create-hmac": "^1.1.0", "diffie-hellman": "^5.0.0", "inherits": "^2.0.1", "pbkdf2": "^3.0.3", "public-encrypt": "^4.0.0", "randombytes": "^2.0.0", "randomfill": "^1.0.3" } }, "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg=="],
"crypto-browserify": ["crypto-browserify@3.12.1", "", { "dependencies": { "browserify-cipher": "^1.0.1", "browserify-sign": "^4.2.3", "create-ecdh": "^4.0.4", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", "diffie-hellman": "^5.0.3", "hash-base": "~3.0.4", "inherits": "^2.0.4", "pbkdf2": "^3.1.2", "public-encrypt": "^4.0.3", "randombytes": "^2.1.0", "randomfill": "^1.0.4" } }, "sha512-r4ESw/IlusD17lgQi1O20Fa3qNnsckR126TdUuBgAu7GBYSIPvdNyONd3Zrxh0xCwA4+6w/TDArBPsMvhur+KQ=="],
"define-properties": ["define-properties@1.2.0", "", { "dependencies": { "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA=="],
"define-data-property": ["define-data-property@1.1.4", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" } }, "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A=="],
"des.js": ["des.js@1.0.1", "", { "dependencies": { "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" } }, "sha512-Q0I4pfFrv2VPd34/vfLrFOoRmlYj3OV50i7fskps1jZWK1kApMWWT9G6RRUeYedLcBDIhnSDaUvJMb3AhUlaEA=="],
"define-properties": ["define-properties@1.2.1", "", { "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg=="],
"des.js": ["des.js@1.1.0", "", { "dependencies": { "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0" } }, "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg=="],
"diffie-hellman": ["diffie-hellman@5.0.3", "", { "dependencies": { "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", "randombytes": "^2.0.0" } }, "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg=="],
"domain-browser": ["domain-browser@4.22.0", "", {}, "sha512-IGBwjF7tNk3cwypFNH/7bfzBcgSCbaMOD3GsaY1AU/JRrnHnYgEM0+9kQt52iZxjNsjBtJYtao146V+f8jFZNw=="],
"domain-browser": ["domain-browser@4.23.0", "", {}, "sha512-ArzcM/II1wCCujdCNyQjXrAFwS4mrLh4C7DZWlaI8mdh7h3BfKdNd3bKXITfl2PT9FtfQqaGvhi1vPRQPimjGA=="],
"elliptic": ["elliptic@6.5.4", "", { "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", "hash.js": "^1.0.0", "hmac-drbg": "^1.0.1", "inherits": "^2.0.4", "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" } }, "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ=="],
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
"es6-object-assign": ["es6-object-assign@1.1.0", "", {}, "sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw=="],
"elliptic": ["elliptic@6.6.1", "", { "dependencies": { "bn.js": "^4.11.9", "brorand": "^1.1.0", "hash.js": "^1.0.0", "hmac-drbg": "^1.0.1", "inherits": "^2.0.4", "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" } }, "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g=="],
"esbuild": ["esbuild@0.14.54", "", { "dependencies": { "@esbuild/linux-loong64": "0.14.54", "esbuild-android-64": "0.14.54", "esbuild-android-arm64": "0.14.54", "esbuild-darwin-64": "0.14.54", "esbuild-darwin-arm64": "0.14.54", "esbuild-freebsd-64": "0.14.54", "esbuild-freebsd-arm64": "0.14.54", "esbuild-linux-32": "0.14.54", "esbuild-linux-64": "0.14.54", "esbuild-linux-arm": "0.14.54", "esbuild-linux-arm64": "0.14.54", "esbuild-linux-mips64le": "0.14.54", "esbuild-linux-ppc64le": "0.14.54", "esbuild-linux-riscv64": "0.14.54", "esbuild-linux-s390x": "0.14.54", "esbuild-netbsd-64": "0.14.54", "esbuild-openbsd-64": "0.14.54", "esbuild-sunos-64": "0.14.54", "esbuild-windows-32": "0.14.54", "esbuild-windows-64": "0.14.54", "esbuild-windows-arm64": "0.14.54" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA=="],
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
"esbuild-android-64": ["esbuild-android-64@0.14.54", "", { "os":"android", "cpu":"x64" }, "sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ=="],
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
"esbuild-android-arm64": ["esbuild-android-arm64@0.14.54", "", { "os":"android", "cpu":"arm64" }, "sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg=="],
"es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="],
"esbuild-darwin-64": ["esbuild-darwin-64@0.14.54", "", { "os":"darwin", "cpu":"x64" }, "sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug=="],
"esbuild-darwin-arm64": ["esbuild-darwin-arm64@0.14.54", "", { "os":"darwin", "cpu":"arm64" }, "sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw=="],
"esbuild-freebsd-64": ["esbuild-freebsd-64@0.14.54", "", { "os":"freebsd", "cpu":"x64" }, "sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg=="],
"esbuild-freebsd-arm64": ["esbuild-freebsd-arm64@0.14.54", "", { "os":"freebsd", "cpu":"arm64" }, "sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q=="],
"esbuild-linux-32": ["esbuild-linux-32@0.14.54", "", { "os":"linux", "cpu":"ia32" }, "sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw=="],
"esbuild-linux-64": ["esbuild-linux-64@0.14.54", "", { "os":"linux", "cpu":"x64" }, "sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg=="],
"esbuild-linux-arm": ["esbuild-linux-arm@0.14.54", "", { "os":"linux", "cpu":"arm" }, "sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw=="],
"esbuild-linux-arm64": ["esbuild-linux-arm64@0.14.54", "", { "os":"linux", "cpu":"arm64" }, "sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig=="],
"esbuild-linux-mips64le": ["esbuild-linux-mips64le@0.14.54", "", { "os":"linux", "cpu":"none" }, "sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw=="],
"esbuild-linux-ppc64le": ["esbuild-linux-ppc64le@0.14.54", "", { "os":"linux", "cpu":"ppc64" }, "sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ=="],
"esbuild-linux-riscv64": ["esbuild-linux-riscv64@0.14.54", "", { "os":"linux", "cpu":"none" }, "sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg=="],
"esbuild-linux-s390x": ["esbuild-linux-s390x@0.14.54", "", { "os":"linux", "cpu":"s390x" }, "sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA=="],
"esbuild-netbsd-64": ["esbuild-netbsd-64@0.14.54", "", { "os":"none", "cpu":"x64" }, "sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w=="],
"esbuild-openbsd-64": ["esbuild-openbsd-64@0.14.54", "", { "os":"openbsd", "cpu":"x64" }, "sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw=="],
"esbuild-sunos-64": ["esbuild-sunos-64@0.14.54", "", { "os":"sunos", "cpu":"x64" }, "sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw=="],
"esbuild-windows-32": ["esbuild-windows-32@0.14.54", "", { "os":"win32", "cpu":"ia32" }, "sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w=="],
"esbuild-windows-64": ["esbuild-windows-64@0.14.54", "", { "os":"win32", "cpu":"x64" }, "sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ=="],
"esbuild-windows-arm64": ["esbuild-windows-arm64@0.14.54", "", { "os":"win32", "cpu":"arm64" }, "sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg=="],
"esbuild": ["esbuild@0.25.4", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.4", "@esbuild/android-arm": "0.25.4", "@esbuild/android-arm64": "0.25.4", "@esbuild/android-x64": "0.25.4", "@esbuild/darwin-arm64": "0.25.4", "@esbuild/darwin-x64": "0.25.4", "@esbuild/freebsd-arm64": "0.25.4", "@esbuild/freebsd-x64": "0.25.4", "@esbuild/linux-arm": "0.25.4", "@esbuild/linux-arm64": "0.25.4", "@esbuild/linux-ia32": "0.25.4", "@esbuild/linux-loong64": "0.25.4", "@esbuild/linux-mips64el": "0.25.4", "@esbuild/linux-ppc64": "0.25.4", "@esbuild/linux-riscv64": "0.25.4", "@esbuild/linux-s390x": "0.25.4", "@esbuild/linux-x64": "0.25.4", "@esbuild/netbsd-arm64": "0.25.4", "@esbuild/netbsd-x64": "0.25.4", "@esbuild/openbsd-arm64": "0.25.4", "@esbuild/openbsd-x64": "0.25.4", "@esbuild/sunos-x64": "0.25.4", "@esbuild/win32-arm64": "0.25.4", "@esbuild/win32-ia32": "0.25.4", "@esbuild/win32-x64": "0.25.4" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-8pgjLUcUjcgDg+2Q4NYXnPbo/vncAY4UmyaCm0jZevERqCHZIaWwdJHkf8XQtu4AxSKCdvrUbT0XUr1IdZzI8Q=="],
"event-target-shim": ["event-target-shim@5.0.1", "", {}, "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="],
@@ -142,26 +165,28 @@
"evp_bytestokey": ["evp_bytestokey@1.0.3", "", { "dependencies": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" } }, "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA=="],
"for-each": ["for-each@0.3.3", "", { "dependencies": { "is-callable": "^1.1.3" } }, "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw=="],
"for-each": ["for-each@0.3.5", "", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg=="],
"function-bind": ["function-bind@1.1.1", "", {}, "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="],
"function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],
"get-intrinsic": ["get-intrinsic@1.2.0", "", { "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", "has-symbols": "^1.0.3" } }, "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q=="],
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
"gopd": ["gopd@1.0.1", "", { "dependencies": { "get-intrinsic": "^1.1.3" } }, "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA=="],
"get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],
"has": ["has@1.0.3", "", { "dependencies": { "function-bind": "^1.1.1" } }, "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw=="],
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
"has-property-descriptors": ["has-property-descriptors@1.0.0", "", { "dependencies": { "get-intrinsic": "^1.1.1" } }, "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ=="],
"has-property-descriptors": ["has-property-descriptors@1.0.2", "", { "dependencies": { "es-define-property": "^1.0.0" } }, "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg=="],
"has-symbols": ["has-symbols@1.0.3", "", {}, "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A=="],
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
"has-tostringtag": ["has-tostringtag@1.0.0", "", { "dependencies": { "has-symbols": "^1.0.2" } }, "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ=="],
"has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="],
"hash-base": ["hash-base@3.1.0", "", { "dependencies": { "inherits": "^2.0.4", "readable-stream": "^3.6.0", "safe-buffer": "^5.2.0" } }, "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA=="],
"hash-base": ["hash-base@3.0.5", "", { "dependencies": { "inherits": "^2.0.4", "safe-buffer": "^5.2.1" } }, "sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg=="],
"hash.js": ["hash.js@1.1.7", "", { "dependencies": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" } }, "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA=="],
"hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
"hmac-drbg": ["hmac-drbg@1.0.1", "", { "dependencies": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", "minimalistic-crypto-utils": "^1.0.1" } }, "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg=="],
"https-browserify": ["https-browserify@1.0.0", "", {}, "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg=="],
@@ -170,15 +195,19 @@
"inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],
"is-arguments": ["is-arguments@1.1.1", "", { "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" } }, "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA=="],
"is-arguments": ["is-arguments@1.2.0", "", { "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" } }, "sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA=="],
"is-callable": ["is-callable@1.2.7", "", {}, "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA=="],
"is-generator-function": ["is-generator-function@1.0.10", "", { "dependencies": { "has-tostringtag": "^1.0.0" } }, "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A=="],
"is-generator-function": ["is-generator-function@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "get-proto": "^1.0.0", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" } }, "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ=="],
"is-nan": ["is-nan@1.3.2", "", { "dependencies": { "call-bind": "^1.0.0", "define-properties": "^1.1.3" } }, "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w=="],
"is-typed-array": ["is-typed-array@1.1.10", "", { "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", "has-tostringtag": "^1.0.0" } }, "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A=="],
"is-regex": ["is-regex@1.2.1", "", { "dependencies": { "call-bound": "^1.0.2", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g=="],
"is-typed-array": ["is-typed-array@1.1.15", "", { "dependencies": { "which-typed-array": "^1.1.16" } }, "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ=="],
"math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],
"md5.js": ["md5.js@1.3.5", "", { "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1", "safe-buffer": "^5.1.2" } }, "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg=="],
@@ -188,27 +217,33 @@
"minimalistic-crypto-utils": ["minimalistic-crypto-utils@1.0.1", "", {}, "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg=="],
"object-is": ["object-is@1.1.5", "", { "dependencies": { "call-bind": "^1.0.2", "define-properties": "^1.1.3" } }, "sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw=="],
"object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
"object-is": ["object-is@1.1.6", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1" } }, "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q=="],
"object-keys": ["object-keys@1.1.1", "", {}, "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="],
"object.assign": ["object.assign@4.1.7", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0", "has-symbols": "^1.1.0", "object-keys": "^1.1.1" } }, "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw=="],
"os-browserify": ["os-browserify@0.3.0", "", {}, "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A=="],
"pako": ["pako@1.0.11", "", {}, "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw=="],
"parse-asn1": ["parse-asn1@5.1.6", "", { "dependencies": { "asn1.js": "^5.2.0", "browserify-aes": "^1.0.0", "evp_bytestokey": "^1.0.0", "pbkdf2": "^3.0.3", "safe-buffer": "^5.1.1" } }, "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw=="],
"parse-asn1": ["parse-asn1@5.1.7", "", { "dependencies": { "asn1.js": "^4.10.1", "browserify-aes": "^1.2.0", "evp_bytestokey": "^1.0.3", "hash-base": "~3.0", "pbkdf2": "^3.1.2", "safe-buffer": "^5.2.1" } }, "sha512-CTM5kuWR3sx9IFamcl5ErfPl6ea/N8IYwiJ+vpeB2g+1iknv7zBl5uPwbMbRVznRVbrNY6lGuDoE5b30grmbqg=="],
"path-browserify": ["path-browserify@1.0.1", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="],
"pbkdf2": ["pbkdf2@3.1.2", "", { "dependencies": { "create-hash": "^1.1.2", "create-hmac": "^1.1.4", "ripemd160": "^2.0.1", "safe-buffer": "^5.0.1", "sha.js": "^2.4.8" } }, "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA=="],
"possible-typed-array-names": ["possible-typed-array-names@1.1.0", "", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="],
"process": ["process@0.11.10", "", {}, "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A=="],
"public-encrypt": ["public-encrypt@4.0.3", "", { "dependencies": { "bn.js": "^4.1.0", "browserify-rsa": "^4.0.0", "create-hash": "^1.1.0", "parse-asn1": "^5.0.0", "randombytes": "^2.0.1", "safe-buffer": "^5.1.2" } }, "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q=="],
"punycode": ["punycode@2.3.0", "", {}, "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA=="],
"punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="],
"querystring": ["querystring@0.2.0", "", {}, "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g=="],
"qs": ["qs@6.14.0", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w=="],
"querystring-es3": ["querystring-es3@1.0.0-0", "", { "dependencies": { "buffer": "5.0.5" } }, "sha512-0etE6Uj4NYut0/y/6pFgVRDAaFtf6x/n4xnBRL82c8n6yigRBepcgPaBAn2o8EhA9QQR1l8b1Je5s+LsJ+zS+g=="],
@@ -216,20 +251,30 @@
"randomfill": ["randomfill@1.0.4", "", { "dependencies": { "randombytes": "^2.0.5", "safe-buffer": "^5.1.0" } }, "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw=="],
"react-refresh": ["react-refresh@0.16.0", "", {}, "sha512-FPvF2XxTSikpJxcr+bHut2H4gJ17+18Uy20D5/F+SKzFap62R3cM5wH6b8WN3LyGSYeQilLEcJcR1fjBSI2S1A=="],
"react-refresh": ["react-refresh@0.17.0", "", {}, "sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ=="],
"readable-stream": ["readable-stream@4.3.0", "", { "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", "events": "^3.3.0", "process": "^0.11.10" } }, "sha512-MuEnA0lbSi7JS8XM+WNJlWZkHAAdm7gETHdFK//Q/mChGyj2akEFtdLZh32jSdkWGbRwCW9pn6g3LWDdDeZnBQ=="],
"readable-stream": ["readable-stream@4.7.0", "", { "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", "events": "^3.3.0", "process": "^0.11.10", "string_decoder": "^1.3.0" } }, "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg=="],
"ripemd160": ["ripemd160@2.0.2", "", { "dependencies": { "hash-base": "^3.0.0", "inherits": "^2.0.1" } }, "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA=="],
"safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],
"safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],
"safe-regex-test": ["safe-regex-test@1.1.0", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-regex": "^1.2.1" } }, "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw=="],
"set-function-length": ["set-function-length@1.2.2", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" } }, "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg=="],
"setimmediate": ["setimmediate@1.0.5", "", {}, "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA=="],
"sha.js": ["sha.js@2.4.11", "", { "dependencies": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" }, "bin": { "sha.js": "./bin.js" } }, "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ=="],
"side-channel": ["side-channel@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="],
"side-channel-list": ["side-channel-list@1.0.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" } }, "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA=="],
"side-channel-map": ["side-channel-map@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="],
"side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="],
"stream-http": ["stream-http@3.2.0", "", { "dependencies": { "builtin-status-codes": "^3.0.0", "inherits": "^2.0.4", "readable-stream": "^3.6.0", "xtend": "^4.0.2" } }, "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A=="],
"string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="],
@@ -238,38 +283,30 @@
"tty-browserify": ["tty-browserify@0.0.1", "", {}, "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw=="],
"url": ["url@0.11.0", "", { "dependencies": { "punycode": "1.3.2", "querystring": "0.2.0" } }, "sha512-kbailJa29QrtXnxgq+DdCEGlbTeYM2eJUxsz6vjZavrCYPMIFHMKQmSKYAIuUK2i7hgPm28a8piX5NTUtM/LKQ=="],
"url": ["url@0.11.4", "", { "dependencies": { "punycode": "^1.4.1", "qs": "^6.12.3" } }, "sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg=="],
"util": ["util@0.12.5", "", { "dependencies": { "inherits": "^2.0.3", "is-arguments": "^1.0.4", "is-generator-function": "^1.0.7", "is-typed-array": "^1.1.3", "which-typed-array": "^1.1.2" } }, "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA=="],
"util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
"vm-browserify": ["vm-browserify@1.1.2", "", {}, "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ=="],
"which-typed-array": ["which-typed-array@1.1.9", "", { "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", "for-each": "^0.3.3", "gopd": "^1.0.1", "has-tostringtag": "^1.0.0", "is-typed-array": "^1.1.10" } }, "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA=="],
"which-typed-array": ["which-typed-array@1.1.19", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.4", "for-each": "^0.3.5", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" } }, "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw=="],
"xtend": ["xtend@4.0.2", "", {}, "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="],
"asn1.js/bn.js": ["bn.js@4.12.0", "", {}, "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="],
"asn1.js/bn.js": ["bn.js@4.12.2", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
"browserify-sign/readable-stream": ["readable-stream@3.6.0", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA=="],
"create-ecdh/bn.js": ["bn.js@4.12.2", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
"create-ecdh/bn.js": ["bn.js@4.12.0", "", {}, "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="],
"diffie-hellman/bn.js": ["bn.js@4.12.2", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
"diffie-hellman/bn.js": ["bn.js@4.12.0", "", {}, "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="],
"elliptic/bn.js": ["bn.js@4.12.2", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
"elliptic/bn.js": ["bn.js@4.12.0", "", {}, "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="],
"miller-rabin/bn.js": ["bn.js@4.12.2", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
"hash-base/readable-stream": ["readable-stream@3.6.0", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA=="],
"miller-rabin/bn.js": ["bn.js@4.12.0", "", {}, "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="],
"public-encrypt/bn.js": ["bn.js@4.12.0", "", {}, "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="],
"public-encrypt/bn.js": ["bn.js@4.12.2", "", {}, "sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw=="],
"querystring-es3/buffer": ["buffer@5.0.5", "", { "dependencies": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" } }, "sha512-ye69HVxM0Htf+E5YhFLOfHX8dXOkammTDtqCU5xLFMlPYTQkNJ7Kv6I90TjZiPH1yXBHQdRvSAK28EZSwSm3Dg=="],
"stream-http/readable-stream": ["readable-stream@3.6.0", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA=="],
"url/punycode": ["punycode@1.3.2", "", {}, "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw=="],
"url/punycode": ["punycode@1.4.1", "", {}, "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ=="],
}
}

View File

@@ -1,6 +1 @@
/**
* Browser polyfill for the `"console"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export default console;

View File

@@ -1,7 +1,208 @@
/**
* Browser polyfill for the `"constants"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export * from "constants-browserify";
// equivalent to browserify constants module, converted to an ES module
export const O_RDONLY = 0;
export const O_WRONLY = 1;
export const O_RDWR = 2;
export const S_IFMT = 61440;
export const S_IFREG = 32768;
export const S_IFDIR = 16384;
export const S_IFCHR = 8192;
export const S_IFBLK = 24576;
export const S_IFIFO = 4096;
export const S_IFLNK = 40960;
export const S_IFSOCK = 49152;
export const O_CREAT = 512;
export const O_EXCL = 2048;
export const O_NOCTTY = 131072;
export const O_TRUNC = 1024;
export const O_APPEND = 8;
export const O_DIRECTORY = 1048576;
export const O_NOFOLLOW = 256;
export const O_SYNC = 128;
export const O_SYMLINK = 2097152;
export const O_NONBLOCK = 4;
export const S_IRWXU = 448;
export const S_IRUSR = 256;
export const S_IWUSR = 128;
export const S_IXUSR = 64;
export const S_IRWXG = 56;
export const S_IRGRP = 32;
export const S_IWGRP = 16;
export const S_IXGRP = 8;
export const S_IRWXO = 7;
export const S_IROTH = 4;
export const S_IWOTH = 2;
export const S_IXOTH = 1;
export const E2BIG = 7;
export const EACCES = 13;
export const EADDRINUSE = 48;
export const EADDRNOTAVAIL = 49;
export const EAFNOSUPPORT = 47;
export const EAGAIN = 35;
export const EALREADY = 37;
export const EBADF = 9;
export const EBADMSG = 94;
export const EBUSY = 16;
export const ECANCELED = 89;
export const ECHILD = 10;
export const ECONNABORTED = 53;
export const ECONNREFUSED = 61;
export const ECONNRESET = 54;
export const EDEADLK = 11;
export const EDESTADDRREQ = 39;
export const EDOM = 33;
export const EDQUOT = 69;
export const EEXIST = 17;
export const EFAULT = 14;
export const EFBIG = 27;
export const EHOSTUNREACH = 65;
export const EIDRM = 90;
export const EILSEQ = 92;
export const EINPROGRESS = 36;
export const EINTR = 4;
export const EINVAL = 22;
export const EIO = 5;
export const EISCONN = 56;
export const EISDIR = 21;
export const ELOOP = 62;
export const EMFILE = 24;
export const EMLINK = 31;
export const EMSGSIZE = 40;
export const EMULTIHOP = 95;
export const ENAMETOOLONG = 63;
export const ENETDOWN = 50;
export const ENETRESET = 52;
export const ENETUNREACH = 51;
export const ENFILE = 23;
export const ENOBUFS = 55;
export const ENODATA = 96;
export const ENODEV = 19;
export const ENOENT = 2;
export const ENOEXEC = 8;
export const ENOLCK = 77;
export const ENOLINK = 97;
export const ENOMEM = 12;
export const ENOMSG = 91;
export const ENOPROTOOPT = 42;
export const ENOSPC = 28;
export const ENOSR = 98;
export const ENOSTR = 99;
export const ENOSYS = 78;
export const ENOTCONN = 57;
export const ENOTDIR = 20;
export const ENOTEMPTY = 66;
export const ENOTSOCK = 38;
export const ENOTSUP = 45;
export const ENOTTY = 25;
export const ENXIO = 6;
export const EOPNOTSUPP = 102;
export const EOVERFLOW = 84;
export const EPERM = 1;
export const EPIPE = 32;
export const EPROTO = 100;
export const EPROTONOSUPPORT = 43;
export const EPROTOTYPE = 41;
export const ERANGE = 34;
export const EROFS = 30;
export const ESPIPE = 29;
export const ESRCH = 3;
export const ESTALE = 70;
export const ETIME = 101;
export const ETIMEDOUT = 60;
export const ETXTBSY = 26;
export const EWOULDBLOCK = 35;
export const EXDEV = 18;
export const SIGHUP = 1;
export const SIGINT = 2;
export const SIGQUIT = 3;
export const SIGILL = 4;
export const SIGTRAP = 5;
export const SIGABRT = 6;
export const SIGIOT = 6;
export const SIGBUS = 10;
export const SIGFPE = 8;
export const SIGKILL = 9;
export const SIGUSR1 = 30;
export const SIGSEGV = 11;
export const SIGUSR2 = 31;
export const SIGPIPE = 13;
export const SIGALRM = 14;
export const SIGTERM = 15;
export const SIGCHLD = 20;
export const SIGCONT = 19;
export const SIGSTOP = 17;
export const SIGTSTP = 18;
export const SIGTTIN = 21;
export const SIGTTOU = 22;
export const SIGURG = 16;
export const SIGXCPU = 24;
export const SIGXFSZ = 25;
export const SIGVTALRM = 26;
export const SIGPROF = 27;
export const SIGWINCH = 28;
export const SIGIO = 23;
export const SIGSYS = 12;
export const SSL_OP_ALL = 2147486719;
export const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = 262144;
export const SSL_OP_CIPHER_SERVER_PREFERENCE = 4194304;
export const SSL_OP_CISCO_ANYCONNECT = 32768;
export const SSL_OP_COOKIE_EXCHANGE = 8192;
export const SSL_OP_CRYPTOPRO_TLSEXT_BUG = 2147483648;
export const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 2048;
export const SSL_OP_EPHEMERAL_RSA = 0;
export const SSL_OP_LEGACY_SERVER_CONNECT = 4;
export const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = 32;
export const SSL_OP_MICROSOFT_SESS_ID_BUG = 1;
export const SSL_OP_MSIE_SSLV2_RSA_PADDING = 0;
export const SSL_OP_NETSCAPE_CA_DN_BUG = 536870912;
export const SSL_OP_NETSCAPE_CHALLENGE_BUG = 2;
export const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = 1073741824;
export const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = 8;
export const SSL_OP_NO_COMPRESSION = 131072;
export const SSL_OP_NO_QUERY_MTU = 4096;
export const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 65536;
export const SSL_OP_NO_SSLv2 = 16777216;
export const SSL_OP_NO_SSLv3 = 33554432;
export const SSL_OP_NO_TICKET = 16384;
export const SSL_OP_NO_TLSv1 = 67108864;
export const SSL_OP_NO_TLSv1_1 = 268435456;
export const SSL_OP_NO_TLSv1_2 = 134217728;
export const SSL_OP_PKCS1_CHECK_1 = 0;
export const SSL_OP_PKCS1_CHECK_2 = 0;
export const SSL_OP_SINGLE_DH_USE = 1048576;
export const SSL_OP_SINGLE_ECDH_USE = 524288;
export const SSL_OP_SSLEAY_080_CLIENT_DH_BUG = 128;
export const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = 0;
export const SSL_OP_TLS_BLOCK_PADDING_BUG = 512;
export const SSL_OP_TLS_D5_BUG = 256;
export const SSL_OP_TLS_ROLLBACK_BUG = 8388608;
export const ENGINE_METHOD_DSA = 2;
export const ENGINE_METHOD_DH = 4;
export const ENGINE_METHOD_RAND = 8;
export const ENGINE_METHOD_ECDH = 16;
export const ENGINE_METHOD_ECDSA = 32;
export const ENGINE_METHOD_CIPHERS = 64;
export const ENGINE_METHOD_DIGESTS = 128;
export const ENGINE_METHOD_STORE = 256;
export const ENGINE_METHOD_PKEY_METHS = 512;
export const ENGINE_METHOD_PKEY_ASN1_METHS = 1024;
export const ENGINE_METHOD_ALL = 65535;
export const ENGINE_METHOD_NONE = 0;
export const DH_CHECK_P_NOT_SAFE_PRIME = 2;
export const DH_CHECK_P_NOT_PRIME = 1;
export const DH_UNABLE_TO_CHECK_GENERATOR = 4;
export const DH_NOT_SUITABLE_GENERATOR = 8;
export const NPN_ENABLED = 1;
export const RSA_PKCS1_PADDING = 1;
export const RSA_SSLV23_PADDING = 2;
export const RSA_NO_PADDING = 3;
export const RSA_PKCS1_OAEP_PADDING = 4;
export const RSA_X931_PADDING = 5;
export const RSA_PKCS1_PSS_PADDING = 6;
export const POINT_CONVERSION_COMPRESSED = 2;
export const POINT_CONVERSION_UNCOMPRESSED = 4;
export const POINT_CONVERSION_HYBRID = 6;
export const F_OK = 0;
export const R_OK = 4;
export const W_OK = 2;
export const X_OK = 1;
export const UV_UDP_REUSEADDR = 4;

View File

@@ -1,11 +1,44 @@
/**
* Browser polyfill for the `"crypto"` module.
*
* Imported on usage in `bun build --target=browser`
*/
import cryptoBrowserify from "crypto-browserify";
export * from "crypto-browserify";
import * as cryptoBrowserify from "crypto-browserify";
export const prng = cryptoBrowserify.prng;
export const pseudoRandomBytes = cryptoBrowserify.pseudoRandomBytes;
export const rng = cryptoBrowserify.rng;
export const randomBytes = cryptoBrowserify.randomBytes;
export const Hash = cryptoBrowserify.Hash;
export const createHash = cryptoBrowserify.createHash;
export const Hmac = cryptoBrowserify.Hmac;
export const createHmac = cryptoBrowserify.createHmac;
export const getHashes = cryptoBrowserify.getHashes;
export const pbkdf2 = cryptoBrowserify.pbkdf2;
export const pbkdf2Sync = cryptoBrowserify.pbkdf2Sync;
export const Cipher = cryptoBrowserify.Cipher;
export const createCipher = cryptoBrowserify.createCipher;
export const Cipheriv = cryptoBrowserify.Cipheriv;
export const createCipheriv = cryptoBrowserify.createCipheriv;
export const Decipher = cryptoBrowserify.Decipher;
export const createDecipher = cryptoBrowserify.createDecipher;
export const Decipheriv = cryptoBrowserify.Decipheriv;
export const createDecipheriv = cryptoBrowserify.createDecipheriv;
export const getCiphers = cryptoBrowserify.getCiphers;
export const listCiphers = cryptoBrowserify.listCiphers;
export const DiffieHellmanGroup = cryptoBrowserify.DiffieHellmanGroup;
export const createDiffieHellmanGroup = cryptoBrowserify.createDiffieHellmanGroup;
export const getDiffieHellman = cryptoBrowserify.getDiffieHellman;
export const createDiffieHellman = cryptoBrowserify.createDiffieHellman;
export const DiffieHellman = cryptoBrowserify.DiffieHellman;
export const createSign = cryptoBrowserify.createSign;
export const Sign = cryptoBrowserify.Sign;
export const createVerify = cryptoBrowserify.createVerify;
export const Verify = cryptoBrowserify.Verify;
export const createECDH = cryptoBrowserify.createECDH;
export const publicEncrypt = cryptoBrowserify.publicEncrypt;
export const privateEncrypt = cryptoBrowserify.privateEncrypt;
export const publicDecrypt = cryptoBrowserify.publicDecrypt;
export const privateDecrypt = cryptoBrowserify.privateDecrypt;
export const randomFill = cryptoBrowserify.randomFill;
export const randomFillSync = cryptoBrowserify.randomFillSync;
export const createCredentials = cryptoBrowserify.createCredentials;
export const constants = cryptoBrowserify.constants;
export var DEFAULT_ENCODING = "buffer";
@@ -18,7 +51,7 @@ export const randomUUID = () => {
return crypto.randomUUID();
};
const harcoded_curves = [
const hardcoded_curves = [
"p192",
"p224",
"p256",
@@ -36,42 +69,7 @@ const harcoded_curves = [
];
export function getCurves() {
return harcoded_curves;
}
export const timingSafeEqual =
"timingSafeEqual" in crypto
? (a, b) => {
const { byteLength: byteLengthA } = a;
const { byteLength: byteLengthB } = b;
if (typeof byteLengthA !== "number" || typeof byteLengthB !== "number") {
throw new TypeError("Input must be an array buffer view");
}
if (byteLengthA !== byteLengthB) {
throw new RangeError("Input buffers must have the same length");
}
// these error checks are also performed in the function
// however there is a bug where exceptions return no value
return crypto.timingSafeEqual(a, b);
}
: undefined;
if (timingSafeEqual) {
// hide it from stack trace
Object.defineProperty(timingSafeEqual, "name", {
value: "::bunternal::",
});
return hardcoded_curves;
}
export const webcrypto = crypto;
export default {
...cryptoBrowserify,
getRandomValues,
randomUUID,
timingSafeEqual,
webcrypto,
getCurves,
};

View File

@@ -1,8 +1,2 @@
/**
* Browser polyfill for the `"domain"` module.
*
* Imported on usage in `bun build --target=browser`
*/
import domain from "domain-browser";
export default domain;
export var { create, createDomain } = domain;

View File

@@ -1,487 +1,546 @@
/**
* Browser polyfill for the `"events"` module.
*
* Imported on usage in `bun build --target=browser`
*/
// Copyright Joyent, Inc. and other Node contributors.
// NOTE: THIS IS A BROWSER POLYFILL - Bun's actual node:* modules are in src/js/node
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// TODO: This file is copy pasted from that, and should be generated from that,
// in a way that excludes async_hooks related functions. Those will never be
// available in the browser. Also, Node.js has some addition hooks to allow
// these functions to take secret data out of EventTarget. those cannot be
// included here either.
"use strict";
const SymbolFor = Symbol.for;
var R = typeof Reflect === "object" ? Reflect : null;
var ReflectApply =
R && typeof R.apply === "function"
? R.apply
: function ReflectApply(target, receiver, args) {
return Function.prototype.apply.call(target, receiver, args);
};
const kCapture = Symbol("kCapture");
const kErrorMonitor = SymbolFor("events.errorMonitor");
const kMaxEventTargetListeners = Symbol("events.maxEventTargetListeners");
const kMaxEventTargetListenersWarned = Symbol("events.maxEventTargetListenersWarned");
const kRejection = SymbolFor("nodejs.rejection");
const captureRejectionSymbol = SymbolFor("nodejs.rejection");
const ArrayPrototypeSlice = Array.prototype.slice;
var ReflectOwnKeys;
if (R && typeof R.ownKeys === "function") {
ReflectOwnKeys = R.ownKeys;
} else if (Object.getOwnPropertySymbols) {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
};
} else {
ReflectOwnKeys = function ReflectOwnKeys(target) {
return Object.getOwnPropertyNames(target);
};
}
function ProcessEmitWarning(warning) {
if (console && console.warn) console.warn(warning);
}
var NumberIsNaN =
Number.isNaN ||
function NumberIsNaN(value) {
return value !== value;
};
function EventEmitter() {
EventEmitter.init.call(this);
}
// Backwards-compat with node 0.10.x
EventEmitter.EventEmitter = EventEmitter;
EventEmitter.prototype._events = undefined;
EventEmitter.prototype._eventsCount = 0;
EventEmitter.prototype._maxListeners = undefined;
// By default EventEmitters will print a warning if more than 10 listeners are
// added to it. This is a useful default which helps finding memory leaks.
var defaultMaxListeners = 10;
function checkListener(listener) {
if (typeof listener !== "function") {
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
}
}
Object.defineProperty(EventEmitter, "defaultMaxListeners", {
enumerable: true,
get: function () {
return defaultMaxListeners;
},
set: function (arg) {
if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
throw new RangeError(
'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".",
);
}
defaultMaxListeners = arg;
},
});
EventEmitter.init = function () {
if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) {
this._events = Object.create(null);
// EventEmitter must be a standard function because some old code will do weird tricks like `EventEmitter.$apply(this)`.
const EventEmitter = function EventEmitter(opts) {
if (this._events === undefined || this._events === this.__proto__._events) {
this._events = { __proto__: null };
this._eventsCount = 0;
}
this._maxListeners = this._maxListeners || undefined;
};
// Obviously not all Emitters should be limited to 10. This function allows
// that to be increased. Set to zero for unlimited.
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
this._maxListeners ??= undefined;
if ((this[kCapture] = opts?.captureRejections ? Boolean(opts?.captureRejections) : EventEmitterPrototype[kCapture])) {
this.emit = emitWithRejectionCapture;
}
};
const EventEmitterPrototype = (EventEmitter.prototype = {});
EventEmitterPrototype._events = undefined;
EventEmitterPrototype._eventsCount = 0;
EventEmitterPrototype._maxListeners = undefined;
EventEmitterPrototype.setMaxListeners = function setMaxListeners(n) {
validateNumber(n, "setMaxListeners", 0);
this._maxListeners = n;
return this;
};
function _getMaxListeners(that) {
if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners;
return that._maxListeners;
}
EventEmitterPrototype.constructor = EventEmitter;
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
return _getMaxListeners(this);
EventEmitterPrototype.getMaxListeners = function getMaxListeners() {
return this?._maxListeners ?? defaultMaxListeners;
};
EventEmitter.prototype.emit = function emit(type) {
var args = [];
for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
var doError = type === "error";
var events = this._events;
if (events !== undefined) doError = doError && events.error === undefined;
else if (!doError) return false;
// If there is no 'error' event listener then throw.
if (doError) {
var er;
if (args.length > 0) er = args[0];
if (er instanceof Error) {
// Note: The comments on the `throw` lines are intentional, they show
// up in Node's output if this results in an unhandled exception.
throw er; // Unhandled 'error' event
function emitError(emitter, args) {
var { _events: events } = emitter;
args[0] ??= new Error("Unhandled error.");
if (!events) throw args[0];
var errorMonitor = events[kErrorMonitor];
if (errorMonitor) {
for (var handler of ArrayPrototypeSlice.$call(errorMonitor)) {
handler.$apply(emitter, args);
}
// At least give some kind of context to the user
var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
err.context = er;
throw err; // Unhandled 'error' event
}
var handler = events[type];
if (handler === undefined) return false;
if (typeof handler === "function") {
ReflectApply(handler, this, args);
} else {
var len = handler.length;
var listeners = arrayClone(handler, len);
for (var i = 0; i < len; ++i) ReflectApply(listeners[i], this, args);
var handlers = events.error;
if (!handlers) throw args[0];
for (var handler of ArrayPrototypeSlice.$call(handlers)) {
handler.$apply(emitter, args);
}
return true;
};
function _addListener(target, type, listener, prepend) {
var m;
var events;
var existing;
checkListener(listener);
events = target._events;
if (events === undefined) {
events = target._events = Object.create(null);
target._eventsCount = 0;
} else {
// To avoid recursion in the case that type === "newListener"! Before
// adding it to the listeners, first emit "newListener".
if (events.newListener !== undefined) {
target.emit("newListener", type, listener.listener ? listener.listener : listener);
// Re-assign `events` because a newListener handler could have caused the
// this._events to be assigned to a new object
events = target._events;
}
existing = events[type];
}
if (existing === undefined) {
// Optimize the case of one listener. Don't need the extra array object.
existing = events[type] = listener;
++target._eventsCount;
} else {
if (typeof existing === "function") {
// Adding the second element, need to change to array.
existing = events[type] = prepend ? [listener, existing] : [existing, listener];
// If we've already got an array, just append.
} else if (prepend) {
existing.unshift(listener);
} else {
existing.push(listener);
}
// Check for listener leak
m = _getMaxListeners(target);
if (m > 0 && existing.length > m && !existing.warned) {
existing.warned = true;
// No error code for this since it is a Warning
// eslint-disable-next-line no-restricted-syntax
var w = new Error(
"Possible EventEmitter memory leak detected. " +
existing.length +
" " +
String(type) +
" listeners " +
"added. Use emitter.setMaxListeners() to " +
"increase limit",
);
w.name = "MaxListenersExceededWarning";
w.emitter = target;
w.type = type;
w.count = existing.length;
ProcessEmitWarning(w);
}
}
return target;
}
EventEmitter.prototype.addListener = function addListener(type, listener) {
return _addListener(this, type, listener, false);
};
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
EventEmitter.prototype.prependListener = function prependListener(type, listener) {
return _addListener(this, type, listener, true);
};
function onceWrapper() {
if (!this.fired) {
this.target.removeListener(this.type, this.wrapFn);
this.fired = true;
if (arguments.length === 0) return this.listener.call(this.target);
return this.listener.apply(this.target, arguments);
}
}
function _onceWrap(target, type, listener) {
var state = {
fired: false,
wrapFn: undefined,
target: target,
type: type,
listener: listener,
};
var wrapped = onceWrapper.bind(state);
wrapped.listener = listener;
state.wrapFn = wrapped;
return wrapped;
}
EventEmitter.prototype.once = function once(type, listener) {
checkListener(listener);
this.on(type, _onceWrap(this, type, listener));
return this;
};
EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
checkListener(listener);
this.prependListener(type, _onceWrap(this, type, listener));
return this;
};
// Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeListener = function removeListener(type, listener) {
var list, events, position, i, originalListener;
checkListener(listener);
events = this._events;
if (events === undefined) return this;
list = events[type];
if (list === undefined) return this;
if (list === listener || list.listener === listener) {
if (--this._eventsCount === 0) this._events = Object.create(null);
else {
delete events[type];
if (events.removeListener) this.emit("removeListener", type, list.listener || listener);
}
} else if (typeof list !== "function") {
position = -1;
for (i = list.length - 1; i >= 0; i--) {
if (list[i] === listener || list[i].listener === listener) {
originalListener = list[i].listener;
position = i;
break;
}
}
if (position < 0) return this;
if (position === 0) list.shift();
else {
spliceOne(list, position);
}
if (list.length === 1) events[type] = list[0];
if (events.removeListener !== undefined) this.emit("removeListener", type, originalListener || listener);
}
return this;
};
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
var listeners, events, i;
events = this._events;
if (events === undefined) return this;
// not listening for removeListener, no need to emit
if (events.removeListener === undefined) {
if (arguments.length === 0) {
this._events = Object.create(null);
this._eventsCount = 0;
} else if (events[type] !== undefined) {
if (--this._eventsCount === 0) this._events = Object.create(null);
else delete events[type];
}
return this;
}
// emit removeListener for all listeners on all events
if (arguments.length === 0) {
var keys = Object.keys(events);
var key;
for (i = 0; i < keys.length; ++i) {
key = keys[i];
if (key === "removeListener") continue;
this.removeAllListeners(key);
}
this.removeAllListeners("removeListener");
this._events = Object.create(null);
this._eventsCount = 0;
return this;
}
listeners = events[type];
if (typeof listeners === "function") {
this.removeListener(type, listeners);
} else if (listeners !== undefined) {
// LIFO order
for (i = listeners.length - 1; i >= 0; i--) {
this.removeListener(type, listeners[i]);
}
}
return this;
};
function _listeners(target, type, unwrap) {
var events = target._events;
if (events === undefined) return [];
var evlistener = events[type];
if (evlistener === undefined) return [];
if (typeof evlistener === "function") return unwrap ? [evlistener.listener || evlistener] : [evlistener];
return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
}
EventEmitter.prototype.listeners = function listeners(type) {
return _listeners(this, type, true);
};
EventEmitter.prototype.rawListeners = function rawListeners(type) {
return _listeners(this, type, false);
};
EventEmitter.listenerCount = function (emitter, type) {
if (typeof emitter.listenerCount === "function") {
return emitter.listenerCount(type);
} else {
return listenerCount.call(emitter, type);
}
};
EventEmitter.prototype.listenerCount = listenerCount;
function listenerCount(type) {
var events = this._events;
if (events !== undefined) {
var evlistener = events[type];
if (typeof evlistener === "function") {
return 1;
} else if (evlistener !== undefined) {
return evlistener.length;
}
}
return 0;
}
EventEmitter.prototype.eventNames = function eventNames() {
return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
};
function arrayClone(arr, n) {
var copy = new Array(n);
for (var i = 0; i < n; ++i) copy[i] = arr[i];
return copy;
}
function spliceOne(list, index) {
for (; index + 1 < list.length; index++) list[index] = list[index + 1];
list.pop();
}
function unwrapListeners(arr) {
var ret = new Array(arr.length);
for (var i = 0; i < ret.length; ++i) {
ret[i] = arr[i].listener || arr[i];
}
return ret;
}
function once(emitter, name) {
return new Promise(function (resolve, reject) {
function errorListener(err) {
emitter.removeListener(name, resolver);
reject(err);
}
function resolver() {
if (typeof emitter.removeListener === "function") {
emitter.removeListener("error", errorListener);
}
resolve([].slice.call(arguments));
}
eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
if (name !== "error") {
addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
}
function addCatch(emitter, promise, type, args) {
promise.then(undefined, function (err) {
// The callback is called with nextTick to avoid a follow-up rejection from this promise.
process.nextTick(emitUnhandledRejectionOrErr, emitter, err, type, args);
});
}
function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
if (typeof emitter.on === "function") {
eventTargetAgnosticAddListener(emitter, "error", handler, flags);
function emitUnhandledRejectionOrErr(emitter, err, type, args) {
if (typeof emitter[kRejection] === "function") {
emitter[kRejection](err, type, ...args);
} else {
// If the error handler throws, it is not catchable and it will end up in 'uncaughtException'.
// We restore the previous value of kCapture in case the uncaughtException is present
// and the exception is handled.
try {
emitter[kCapture] = false;
emitter.emit("error", err);
} finally {
emitter[kCapture] = true;
}
}
}
const emitWithoutRejectionCapture = function emit(type, ...args) {
if (type === "error") {
return emitError(this, args);
}
var { _events: events } = this;
if (events === undefined) return false;
var handlers = events[type];
if (handlers === undefined) return false;
// Clone handlers array if necessary since handlers can be added/removed during the loop.
// Cloning is skipped for performance reasons in the case of exactly one attached handler
// since array length changes have no side-effects in a for-loop of length 1.
const maybeClonedHandlers = handlers.length > 1 ? handlers.slice() : handlers;
for (let i = 0, { length } = maybeClonedHandlers; i < length; i++) {
const handler = maybeClonedHandlers[i];
// For performance reasons Function.call(...) is used whenever possible.
switch (args.length) {
case 0:
handler.$call(this);
break;
case 1:
handler.$call(this, args[0]);
break;
case 2:
handler.$call(this, args[0], args[1]);
break;
case 3:
handler.$call(this, args[0], args[1], args[2]);
break;
default:
handler.$apply(this, args);
break;
}
}
return true;
};
const emitWithRejectionCapture = function emit(type, ...args) {
if (type === "error") {
return emitError(this, args);
}
var { _events: events } = this;
if (events === undefined) return false;
var handlers = events[type];
if (handlers === undefined) return false;
// Clone handlers array if necessary since handlers can be added/removed during the loop.
// Cloning is skipped for performance reasons in the case of exactly one attached handler
// since array length changes have no side-effects in a for-loop of length 1.
const maybeClonedHandlers = handlers.length > 1 ? handlers.slice() : handlers;
for (let i = 0, { length } = maybeClonedHandlers; i < length; i++) {
const handler = maybeClonedHandlers[i];
let result;
// For performance reasons Function.call(...) is used whenever possible.
switch (args.length) {
case 0:
result = handler.$call(this);
break;
case 1:
result = handler.$call(this, args[0]);
break;
case 2:
result = handler.$call(this, args[0], args[1]);
break;
case 3:
result = handler.$call(this, args[0], args[1], args[2]);
break;
default:
result = handler.$apply(this, args);
break;
}
if (result !== undefined && $isPromise(result)) {
addCatch(this, result, type, args);
}
}
return true;
};
EventEmitterPrototype.emit = emitWithoutRejectionCapture;
EventEmitterPrototype.addListener = function addListener(type, fn) {
checkListener(fn);
var events = this._events;
if (!events) {
events = this._events = { __proto__: null };
this._eventsCount = 0;
} else if (events.newListener) {
this.emit("newListener", type, fn.listener ?? fn);
}
var handlers = events[type];
if (!handlers) {
events[type] = [fn];
this._eventsCount++;
} else {
handlers.push(fn);
var m = this._maxListeners ?? defaultMaxListeners;
if (m > 0 && handlers.length > m && !handlers.warned) {
overflowWarning(this, type, handlers);
}
}
return this;
};
EventEmitterPrototype.on = EventEmitterPrototype.addListener;
EventEmitterPrototype.prependListener = function prependListener(type, fn) {
checkListener(fn);
var events = this._events;
if (!events) {
events = this._events = { __proto__: null };
this._eventsCount = 0;
} else if (events.newListener) {
this.emit("newListener", type, fn.listener ?? fn);
}
var handlers = events[type];
if (!handlers) {
events[type] = [fn];
this._eventsCount++;
} else {
handlers.unshift(fn);
var m = this._maxListeners ?? defaultMaxListeners;
if (m > 0 && handlers.length > m && !handlers.warned) {
overflowWarning(this, type, handlers);
}
}
return this;
};
function overflowWarning(emitter, type, handlers) {
handlers.warned = true;
const warn = new Error(
`Possible EventEmitter memory leak detected. ${handlers.length} ${String(type)} listeners ` +
`added to [${emitter.constructor.name}]. Use emitter.setMaxListeners() to increase limit`,
);
warn.name = "MaxListenersExceededWarning";
warn.emitter = emitter;
warn.type = type;
warn.count = handlers.length;
process.emitWarning(warn);
}
function onceWrapper(type, listener, ...args) {
this.removeListener(type, listener);
listener.$apply(this, args);
}
EventEmitterPrototype.once = function once(type, fn) {
checkListener(fn);
const bound = onceWrapper.bind(this, type, fn);
bound.listener = fn;
this.addListener(type, bound);
return this;
};
EventEmitterPrototype.prependOnceListener = function prependOnceListener(type, fn) {
checkListener(fn);
const bound = onceWrapper.bind(this, type, fn);
bound.listener = fn;
this.prependListener(type, bound);
return this;
};
EventEmitterPrototype.removeListener = function removeListener(type, fn) {
checkListener(fn);
var { _events: events } = this;
if (!events) return this;
var handlers = events[type];
if (!handlers) return this;
var length = handlers.length;
let position = -1;
for (let i = length - 1; i >= 0; i--) {
if (handlers[i] === fn || handlers[i].listener === fn) {
position = i;
break;
}
}
if (position < 0) return this;
if (position === 0) {
handlers.shift();
} else {
handlers.splice(position, 1);
}
if (handlers.length === 0) {
delete events[type];
this._eventsCount--;
}
return this;
};
EventEmitterPrototype.off = EventEmitterPrototype.removeListener;
EventEmitterPrototype.removeAllListeners = function removeAllListeners(type) {
var { _events: events } = this;
if (type && events) {
if (events[type]) {
delete events[type];
this._eventsCount--;
}
} else {
this._events = { __proto__: null };
}
return this;
};
EventEmitterPrototype.listeners = function listeners(type) {
var { _events: events } = this;
if (!events) return [];
var handlers = events[type];
if (!handlers) return [];
return handlers.map(x => x.listener ?? x);
};
EventEmitterPrototype.rawListeners = function rawListeners(type) {
var { _events } = this;
if (!_events) return [];
var handlers = _events[type];
if (!handlers) return [];
return handlers.slice();
};
EventEmitterPrototype.listenerCount = function listenerCount(type) {
var { _events: events } = this;
if (!events) return 0;
return events[type]?.length ?? 0;
};
EventEmitterPrototype.eventNames = function eventNames() {
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
};
EventEmitterPrototype[kCapture] = false;
function once(emitter, type, options) {
var signal = options?.signal;
validateAbortSignal(signal, "options.signal");
if (signal?.aborted) {
throw new AbortError(undefined, { cause: signal?.reason });
}
const { resolve, reject, promise } = $newPromiseCapability(Promise);
const errorListener = err => {
emitter.removeListener(type, resolver);
if (signal != null) {
eventTargetAgnosticRemoveListener(signal, "abort", abortListener);
}
reject(err);
};
const resolver = (...args) => {
if (typeof emitter.removeListener === "function") {
emitter.removeListener("error", errorListener);
}
if (signal != null) {
eventTargetAgnosticRemoveListener(signal, "abort", abortListener);
}
resolve(args);
};
eventTargetAgnosticAddListener(emitter, type, resolver, { once: true });
if (type !== "error" && typeof emitter.once === "function") {
// EventTarget does not have `error` event semantics like Node
// EventEmitters, we listen to `error` events only on EventEmitters.
emitter.once("error", errorListener);
}
function abortListener() {
eventTargetAgnosticRemoveListener(emitter, type, resolver);
eventTargetAgnosticRemoveListener(emitter, "error", errorListener);
reject(new AbortError(undefined, { cause: signal?.reason }));
}
if (signal != null) {
eventTargetAgnosticAddListener(signal, "abort", abortListener, { once: true });
}
return promise;
}
function getEventListeners(emitter, type) {
return emitter.listeners(type);
}
function setMaxListeners(n, ...eventTargets) {
validateNumber(n, "setMaxListeners", 0);
var length;
if (eventTargets && (length = eventTargets.length)) {
for (let i = 0; i < length; i++) {
eventTargets[i].setMaxListeners(n);
}
} else {
defaultMaxListeners = n;
}
}
function listenerCount(emitter, type) {
return emitter.listenerCount(type);
}
function eventTargetAgnosticRemoveListener(emitter, name, listener, flags) {
if (typeof emitter.removeListener === "function") {
emitter.removeListener(name, listener);
} else {
emitter.removeEventListener(name, listener, flags);
}
}
function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
if (typeof emitter.on === "function") {
if (flags.once) {
emitter.once(name, listener);
} else {
emitter.on(name, listener);
}
} else if (typeof emitter.addEventListener === "function") {
// EventTarget does not have `error` event semantics like Node
// EventEmitters, we do not listen for `error` events here.
emitter.addEventListener(name, function wrapListener(arg) {
// IE does not have builtin `{ once: true }` support so we
// have to do it manually.
if (flags.once) {
emitter.removeEventListener(name, wrapListener);
}
listener(arg);
});
if (flags.once) emitter.once(name, listener);
else emitter.on(name, listener);
} else {
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
emitter.addEventListener(name, listener, flags);
}
}
class AbortError extends Error {
constructor(message = "The operation was aborted", options = undefined) {
if (options !== undefined && typeof options !== "object") {
throw ERR_INVALID_ARG_TYPE("options", "Object", options);
}
super(message, options);
this.code = "ABORT_ERR";
this.name = "AbortError";
}
}
function ERR_INVALID_ARG_TYPE(name, type, value) {
const err = new TypeError(`The "${name}" argument must be of type ${type}. Received ${value}`);
err.code = "ERR_INVALID_ARG_TYPE";
return err;
}
function ERR_OUT_OF_RANGE(name, range, value) {
const err = new RangeError(`The "${name}" argument is out of range. It must be ${range}. Received ${value}`);
err.code = "ERR_OUT_OF_RANGE";
return err;
}
function validateAbortSignal(signal, name) {
if (signal !== undefined && (signal === null || typeof signal !== "object" || !("aborted" in signal))) {
throw ERR_INVALID_ARG_TYPE(name, "AbortSignal", signal);
}
}
function validateNumber(value, name, min, max) {
if (typeof value !== "number") throw ERR_INVALID_ARG_TYPE(name, "number", value);
if (
(min != null && value < min) ||
(max != null && value > max) ||
((min != null || max != null) && Number.isNaN(value))
) {
throw ERR_OUT_OF_RANGE(
name,
`${min != null ? `>= ${min}` : ""}${min != null && max != null ? " && " : ""}${max != null ? `<= ${max}` : ""}`,
value,
);
}
}
function checkListener(listener) {
if (typeof listener !== "function") {
throw new TypeError("The listener must be a function");
}
}
function validateBoolean(value, name) {
if (typeof value !== "boolean") throw ERR_INVALID_ARG_TYPE(name, "boolean", value);
}
function getMaxListeners(emitterOrTarget) {
return emitterOrTarget?._maxListeners ?? defaultMaxListeners;
}
// Copy-pasta from Node.js source code
function addAbortListener(signal, listener) {
if (signal === undefined) {
throw ERR_INVALID_ARG_TYPE("signal", "AbortSignal", signal);
}
validateAbortSignal(signal, "signal");
if (typeof listener !== "function") {
throw ERR_INVALID_ARG_TYPE("listener", "function", listener);
}
let removeEventListener;
if (signal.aborted) {
queueMicrotask(() => listener());
} else {
signal.addEventListener("abort", listener, { __proto__: null, once: true });
removeEventListener = () => {
signal.removeEventListener("abort", listener);
};
}
return {
__proto__: null,
[Symbol.dispose]() {
removeEventListener?.();
},
};
}
Object.defineProperties(EventEmitter, {
captureRejections: {
get() {
return EventEmitterPrototype[kCapture];
},
set(value) {
validateBoolean(value, "EventEmitter.captureRejections");
EventEmitterPrototype[kCapture] = value;
},
enumerable: true,
},
defaultMaxListeners: {
enumerable: true,
get: () => {
return defaultMaxListeners;
},
set: arg => {
validateNumber(arg, "defaultMaxListeners", 0);
defaultMaxListeners = arg;
},
},
kMaxEventTargetListeners: {
value: kMaxEventTargetListeners,
enumerable: false,
configurable: false,
writable: false,
},
kMaxEventTargetListenersWarned: {
value: kMaxEventTargetListenersWarned,
enumerable: false,
configurable: false,
writable: false,
},
});
Object.assign(EventEmitter, {
once,
// on,
getEventListeners,
getMaxListeners,
setMaxListeners,
EventEmitter,
usingDomains: false,
captureRejectionSymbol,
errorMonitor: kErrorMonitor,
addAbortListener,
init: EventEmitter,
listenerCount,
});
export default EventEmitter;
export { EventEmitter, once };
export var prototype = EventEmitter.prototype;
export {
EventEmitter,
addAbortListener,
captureRejectionSymbol,
getEventListeners,
getMaxListeners,
EventEmitter as init,
listenerCount,
once,
setMaxListeners,
};

View File

@@ -1,18 +1,2 @@
/**
* Browser polyfill for the `"http"` module.
*
* Imported on usage in `bun build --target=browser`
*/
import http from "stream-http";
export default http;
export var {
//
request,
get,
ClientRequest,
IncomingMessage,
Agent,
globalAgent,
STATUS_CODES,
METHODS,
} = http;
export var { request, get, ClientRequest, IncomingMessage, Agent, globalAgent, STATUS_CODES, METHODS } = http;

View File

@@ -1,7 +1,19 @@
/**
* Browser polyfill for the `"https"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export * from "https-browserify";
export * as default from "https-browserify";
import * as https from "https-browserify";
export var {
Agent,
ClientRequest,
IncomingMessage,
METHODS,
OutgoingMessage,
STATUS_CODES,
Server,
ServerResponse,
createServer,
get,
globalAgent,
maxHeaderSize,
request,
setMaxIdleHTTPParsers,
validateHeaderName,
validateHeaderValue,
} = https;

View File

@@ -1,9 +1,3 @@
/**
* Browser polyfill for the `"net"` module.
*
* Imported on usage in `bun build --target=browser`
*/
// -----------------------------------------------------------------------------
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@@ -28,11 +22,11 @@
// IPv4 Segment
const v4Seg = "(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])";
const v4Str = `(?:${v4Seg}\\.){3}${v4Seg}`;
const IPv4Reg = new RegExp(`^${v4Str}$`);
const IPv4Reg = /* @__PURE__ */ new RegExp(`^${v4Str}$`);
// IPv6 Segment
const v6Seg = "(?:[0-9a-fA-F]{1,4})";
const IPv6Reg = new RegExp(
const IPv6Reg = /* @__PURE__ */ new RegExp(
"^(?:" +
`(?:${v6Seg}:){7}(?:${v6Seg}|:)|` +
`(?:${v6Seg}:){6}(?:${v4Str}|:${v6Seg}|:)|` +
@@ -58,9 +52,3 @@ export function isIP(s) {
if (isIPv6(s)) return 6;
return 0;
}
export default {
isIP,
isIPv4,
isIPv6,
};

View File

@@ -1,26 +1,64 @@
/**
* Browser polyfill for the `"os"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export const endianness = function () {
return "LE";
};
import os from "os-browserify/browser";
export default os;
export var {
endianness,
hostname,
loadavg,
uptime,
freemem,
totalmem,
cpus,
type,
release,
arch,
platform,
tmpdir,
EOL,
homedir,
networkInterfaces,
getNetworkInterfaces,
} = os;
export const hostname = function () {
if (typeof location !== "undefined") {
return location.hostname;
} else return "";
};
export const loadavg = function () {
return [];
};
export const uptime = function () {
return 0;
};
export const freemem = function () {
return Number.MAX_VALUE;
};
export const totalmem = function () {
return Number.MAX_VALUE;
};
export const cpus = function () {
return [];
};
export const type = function () {
return "Browser";
};
export const release = function () {
if (typeof navigator !== "undefined") {
return navigator.appVersion;
}
return "";
};
export const getNetworkInterfaces = function () {
return {};
};
export const networkInterfaces = getNetworkInterfaces;
export const arch = function () {
return "javascript";
};
export const platform = function () {
return "browser";
};
export const tmpdir = function () {
return "/tmp";
};
export const tmpDir = tmpdir;
export const EOL = "\n";
export const homedir = function () {
return "/";
};

View File

@@ -5,36 +5,38 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build-gen": "bash -c 'esbuild --bundle *.js --outdir=bun --format=esm --platform=browser --external:buffer --external:stream --external:util --external:util/ --external:assert'",
"build": "bash -c 'esbuild --bundle *.js --outdir=out --format=esm --minify --platform=browser'",
"build-react-refresh": "NODE_ENV=development bun build --target=browser --external=* --format=cjs --outfile=out/react-refresh.js ./node_modules/react-refresh/cjs/react-refresh-runtime.development.js --define=process.env.NODE_ENV=development --minify"
"build-gen": "bun build-fallbacks.ts",
"build": "bun run build-gen"
},
"author": "",
"license": "ISC",
"dependencies": {
"assert": "^2.0.0",
"assert": "^2.1.0",
"react-refresh": "0.17.0",
"browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
"console-browserify": "^1.2.0",
"constants-browserify": "^1.0.0",
"crypto-browserify": "^3.12.0",
"domain-browser": "^4.22.0",
"esbuild": "^0.14.10",
"crypto-browserify": "^3.12.1",
"domain-browser": "^4.23.0",
"esbuild": "^0.25.4",
"events": "^3.3.0",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"process": "^0.11.10",
"punycode": "^2.1.1",
"punycode": "^2.3.1",
"querystring-es3": "^1.0.0-0",
"react-refresh": "^0.16.0",
"readable-stream": "^4.1.0",
"readable-stream": "^4.5.2",
"stream-http": "^3.2.0",
"string_decoder": "^1.3.0",
"timers-browserify": "^2.0.12",
"tty-browserify": "^0.0.1",
"url": "^0.11.0",
"util": "^0.12.4",
"url": "^0.11.4",
"util": "^0.12.5",
"vm-browserify": "^1.1.2"
},
"overrides": {
"readable-stream": "^4.5.2"
}
}

View File

@@ -1,61 +1,523 @@
/**
* Browser polyfill for the `"path"` module.
*
* Imported on usage in `bun build --target=browser`
*/
import * as PathModule from "path-browserify";
// 'path' module extracted from Node.js v8.11.1 (only the posix part)
// transplited with Babel
const bindingPosix = PathModule;
const bindingWin32 = PathModule;
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// path-browserify doesn't implement toNamespacedPath
const toNamespacedPathPosix = function (a) {
return a;
};
// path-browserify doesn't implement parse
const parseFn = function () {
throw new Error("Not implemented");
};
"use strict";
bindingPosix.parse ??= parseFn;
bindingWin32.parse ??= parseFn;
function assertPath(path) {
if (typeof path !== "string") {
throw new TypeError("Path must be a string. Received " + JSON.stringify(path));
}
}
export const posix = {
resolve: bindingPosix.resolve.bind(bindingPosix),
normalize: bindingPosix.normalize.bind(bindingPosix),
isAbsolute: bindingPosix.isAbsolute.bind(bindingPosix),
join: bindingPosix.join.bind(bindingPosix),
relative: bindingPosix.relative.bind(bindingPosix),
toNamespacedPath: toNamespacedPathPosix,
dirname: bindingPosix.dirname.bind(bindingPosix),
basename: bindingPosix.basename.bind(bindingPosix),
extname: bindingPosix.extname.bind(bindingPosix),
format: bindingPosix.format.bind(bindingPosix),
parse: bindingPosix.parse.bind(bindingPosix),
sep: "/",
delimiter: ":",
win32: undefined,
posix: undefined,
_makeLong: toNamespacedPathPosix,
};
export const win32 = {
sep: "\\",
delimiter: ";",
win32: undefined,
...posix,
posix,
};
posix.win32 = win32.win32 = win32;
posix.posix = posix;
// Resolves . and .. elements in a path with directory names
function normalizeStringPosix(path, allowAboveRoot) {
var res = "";
var lastSegmentLength = 0;
var lastSlash = -1;
var dots = 0;
var code;
for (var i = 0; i <= path.length; ++i) {
if (i < path.length) code = path.charCodeAt(i);
else if (code === 47 /*/*/) break;
else code = 47 /*/*/;
if (code === 47 /*/*/) {
if (lastSlash === i - 1 || dots === 1) {
// NOOP
} else if (lastSlash !== i - 1 && dots === 2) {
if (
res.length < 2 ||
lastSegmentLength !== 2 ||
res.charCodeAt(res.length - 1) !== 46 /*.*/ ||
res.charCodeAt(res.length - 2) !== 46 /*.*/
) {
if (res.length > 2) {
var lastSlashIndex = res.lastIndexOf("/");
if (lastSlashIndex !== res.length - 1) {
if (lastSlashIndex === -1) {
res = "";
lastSegmentLength = 0;
} else {
res = res.slice(0, lastSlashIndex);
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
}
lastSlash = i;
dots = 0;
continue;
}
} else if (res.length === 2 || res.length === 1) {
res = "";
lastSegmentLength = 0;
lastSlash = i;
dots = 0;
continue;
}
}
if (allowAboveRoot) {
if (res.length > 0) res += "/..";
else res = "..";
lastSegmentLength = 2;
}
} else {
if (res.length > 0) res += "/" + path.slice(lastSlash + 1, i);
else res = path.slice(lastSlash + 1, i);
lastSegmentLength = i - lastSlash - 1;
}
lastSlash = i;
dots = 0;
} else if (code === 46 /*.*/ && dots !== -1) {
++dots;
} else {
dots = -1;
}
}
return res;
}
export default posix;
export const {
function _format(sep, pathObject) {
var dir = pathObject.dir || pathObject.root;
var base = pathObject.base || (pathObject.name || "") + (pathObject.ext || "");
if (!dir) {
return base;
}
if (dir === pathObject.root) {
return dir + base;
}
return dir + sep + base;
}
// path.resolve([from ...], to)
export function resolve() {
var resolvedPath = "";
var resolvedAbsolute = false;
var cwd;
for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
var path;
if (i >= 0) path = arguments[i];
else {
if (cwd === undefined) cwd = process.cwd();
path = cwd;
}
assertPath(path);
// Skip empty entries
if (path.length === 0) {
continue;
}
resolvedPath = path + "/" + resolvedPath;
resolvedAbsolute = path.charCodeAt(0) === 47 /*/*/;
}
// At this point the path should be resolved to a full absolute path, but
// handle relative paths to be safe (might happen when process.cwd() fails)
// Normalize the path
resolvedPath = normalizeStringPosix(resolvedPath, !resolvedAbsolute);
if (resolvedAbsolute) {
if (resolvedPath.length > 0) return "/" + resolvedPath;
else return "/";
} else if (resolvedPath.length > 0) {
return resolvedPath;
} else {
return ".";
}
}
export function normalize(path) {
assertPath(path);
if (path.length === 0) return ".";
var isAbsolute = path.charCodeAt(0) === 47; /*/*/
var trailingSeparator = path.charCodeAt(path.length - 1) === 47; /*/*/
// Normalize the path
path = normalizeStringPosix(path, !isAbsolute);
if (path.length === 0 && !isAbsolute) path = ".";
if (path.length > 0 && trailingSeparator) path += "/";
if (isAbsolute) return "/" + path;
return path;
}
export function isAbsolute(path) {
assertPath(path);
return path.length > 0 && path.charCodeAt(0) === 47 /*/*/;
}
export function join() {
if (arguments.length === 0) return ".";
var joined;
for (var i = 0; i < arguments.length; ++i) {
var arg = arguments[i];
assertPath(arg);
if (arg.length > 0) {
if (joined === undefined) joined = arg;
else joined += "/" + arg;
}
}
if (joined === undefined) return ".";
return normalize(joined);
}
export function relative(from, to) {
assertPath(from);
assertPath(to);
if (from === to) return "";
from = resolve(from);
to = resolve(to);
if (from === to) return "";
// Trim any leading backslashes
var fromStart = 1;
for (; fromStart < from.length; ++fromStart) {
if (from.charCodeAt(fromStart) !== 47 /*/*/) break;
}
var fromEnd = from.length;
var fromLen = fromEnd - fromStart;
// Trim any leading backslashes
var toStart = 1;
for (; toStart < to.length; ++toStart) {
if (to.charCodeAt(toStart) !== 47 /*/*/) break;
}
var toEnd = to.length;
var toLen = toEnd - toStart;
// Compare paths to find the longest common path from root
var length = fromLen < toLen ? fromLen : toLen;
var lastCommonSep = -1;
var i = 0;
for (; i <= length; ++i) {
if (i === length) {
if (toLen > length) {
if (to.charCodeAt(toStart + i) === 47 /*/*/) {
// We get here if `from` is the exact base path for `to`.
// For example: from='/foo/bar'; to='/foo/bar/baz'
return to.slice(toStart + i + 1);
} else if (i === 0) {
// We get here if `from` is the root
// For example: from='/'; to='/foo'
return to.slice(toStart + i);
}
} else if (fromLen > length) {
if (from.charCodeAt(fromStart + i) === 47 /*/*/) {
// We get here if `to` is the exact base path for `from`.
// For example: from='/foo/bar/baz'; to='/foo/bar'
lastCommonSep = i;
} else if (i === 0) {
// We get here if `to` is the root.
// For example: from='/foo'; to='/'
lastCommonSep = 0;
}
}
break;
}
var fromCode = from.charCodeAt(fromStart + i);
var toCode = to.charCodeAt(toStart + i);
if (fromCode !== toCode) break;
else if (fromCode === 47 /*/*/) lastCommonSep = i;
}
var out = "";
// Generate the relative path based on the path difference between `to`
// and `from`
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i) {
if (i === fromEnd || from.charCodeAt(i) === 47 /*/*/) {
if (out.length === 0) out += "..";
else out += "/..";
}
}
// Lastly, append the rest of the destination (`to`) path that comes after
// the common path parts
if (out.length > 0) return out + to.slice(toStart + lastCommonSep);
else {
toStart += lastCommonSep;
if (to.charCodeAt(toStart) === 47 /*/*/) ++toStart;
return to.slice(toStart);
}
}
export function _makeLong(path) {
return path;
}
export function dirname(path) {
assertPath(path);
if (path.length === 0) return ".";
var code = path.charCodeAt(0);
var hasRoot = code === 47; /*/*/
var end = -1;
var matchedSlash = true;
for (var i = path.length - 1; i >= 1; --i) {
code = path.charCodeAt(i);
if (code === 47 /*/*/) {
if (!matchedSlash) {
end = i;
break;
}
} else {
// We saw the first non-path separator
matchedSlash = false;
}
}
if (end === -1) return hasRoot ? "/" : ".";
if (hasRoot && end === 1) return "//";
return path.slice(0, end);
}
export function basename(path, ext) {
if (ext !== undefined && typeof ext !== "string") throw new TypeError('"ext" argument must be a string');
assertPath(path);
var start = 0;
var end = -1;
var matchedSlash = true;
var i;
if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
if (ext.length === path.length && ext === path) return "";
var extIdx = ext.length - 1;
var firstNonSlashEnd = -1;
for (i = path.length - 1; i >= 0; --i) {
var code = path.charCodeAt(i);
if (code === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
start = i + 1;
break;
}
} else {
if (firstNonSlashEnd === -1) {
// We saw the first non-path separator, remember this index in case
// we need it if the extension ends up not matching
matchedSlash = false;
firstNonSlashEnd = i + 1;
}
if (extIdx >= 0) {
// Try to match the explicit extension
if (code === ext.charCodeAt(extIdx)) {
if (--extIdx === -1) {
// We matched the extension, so mark this as the end of our path
// component
end = i;
}
} else {
// Extension does not match, so our result is the entire path
// component
extIdx = -1;
end = firstNonSlashEnd;
}
}
}
}
if (start === end) end = firstNonSlashEnd;
else if (end === -1) end = path.length;
return path.slice(start, end);
} else {
for (i = path.length - 1; i >= 0; --i) {
if (path.charCodeAt(i) === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
start = i + 1;
break;
}
} else if (end === -1) {
// We saw the first non-path separator, mark this as the end of our
// path component
matchedSlash = false;
end = i + 1;
}
}
if (end === -1) return "";
return path.slice(start, end);
}
}
export function extname(path) {
assertPath(path);
var startDot = -1;
var startPart = 0;
var end = -1;
var matchedSlash = true;
// Track the state of characters (if any) we see before our first dot and
// after any path separator we find
var preDotState = 0;
for (var i = path.length - 1; i >= 0; --i) {
var code = path.charCodeAt(i);
if (code === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
if (end === -1) {
// We saw the first non-path separator, mark this as the end of our
// extension
matchedSlash = false;
end = i + 1;
}
if (code === 46 /*.*/) {
// If this is our first dot, mark it as the start of our extension
if (startDot === -1) startDot = i;
else if (preDotState !== 1) preDotState = 1;
} else if (startDot !== -1) {
// We saw a non-dot and non-path separator before our dot, so we should
// have a good chance at having a non-empty extension
preDotState = -1;
}
}
if (
startDot === -1 ||
end === -1 ||
// We saw a non-dot character immediately before the dot
preDotState === 0 ||
// The (right-most) trimmed path component is exactly '..'
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
) {
return "";
}
return path.slice(startDot, end);
}
export function format(pathObject) {
if (pathObject === null || typeof pathObject !== "object") {
throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
}
return _format("/", pathObject);
}
export function parse(path) {
assertPath(path);
var ret = { root: "", dir: "", base: "", ext: "", name: "" };
if (path.length === 0) return ret;
var code = path.charCodeAt(0);
var isAbsolute = code === 47; /*/*/
var start;
if (isAbsolute) {
ret.root = "/";
start = 1;
} else {
start = 0;
}
var startDot = -1;
var startPart = 0;
var end = -1;
var matchedSlash = true;
var i = path.length - 1;
// Track the state of characters (if any) we see before our first dot and
// after any path separator we find
var preDotState = 0;
// Get non-dir info
for (; i >= start; --i) {
code = path.charCodeAt(i);
if (code === 47 /*/*/) {
// If we reached a path separator that was not part of a set of path
// separators at the end of the string, stop now
if (!matchedSlash) {
startPart = i + 1;
break;
}
continue;
}
if (end === -1) {
// We saw the first non-path separator, mark this as the end of our
// extension
matchedSlash = false;
end = i + 1;
}
if (code === 46 /*.*/) {
// If this is our first dot, mark it as the start of our extension
if (startDot === -1) startDot = i;
else if (preDotState !== 1) preDotState = 1;
} else if (startDot !== -1) {
// We saw a non-dot and non-path separator before our dot, so we should
// have a good chance at having a non-empty extension
preDotState = -1;
}
}
if (
startDot === -1 ||
end === -1 ||
// We saw a non-dot character immediately before the dot
preDotState === 0 ||
// The (right-most) trimmed path component is exactly '..'
(preDotState === 1 && startDot === end - 1 && startDot === startPart + 1)
) {
if (end !== -1) {
if (startPart === 0 && isAbsolute) ret.base = ret.name = path.slice(1, end);
else ret.base = ret.name = path.slice(startPart, end);
}
} else {
if (startPart === 0 && isAbsolute) {
ret.name = path.slice(1, startDot);
ret.base = path.slice(1, end);
} else {
ret.name = path.slice(startPart, startDot);
ret.base = path.slice(startPart, end);
}
ret.ext = path.slice(startDot, end);
}
if (startPart > 0) ret.dir = path.slice(0, startPart - 1);
else if (isAbsolute) ret.dir = "/";
return ret;
}
const sep = "/";
const delimiter = ":";
// Use an IIFE to allow for tree-shaking
export const posix = /* @__PURE__ */ (p => ((p.posix = p), p))({
resolve,
normalize,
isAbsolute,
join,
relative,
toNamespacedPath,
_makeLong,
dirname,
basename,
extname,
@@ -63,4 +525,9 @@ export const {
parse,
sep,
delimiter,
} = posix;
win32: null,
posix: null,
});
export { delimiter, sep };
export default posix;

View File

@@ -1,7 +1,96 @@
/**
* Browser polyfill for the `"process"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export * from "process/browser";
export * as default from "process/browser";
// shim for using process in browser
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
if (!draining || !currentQueue) {
return;
}
draining = false;
if (currentQueue.length) {
queue = currentQueue.concat(queue);
} else {
queueIndex = -1;
}
if (queue.length) {
drainQueue();
}
}
function drainQueue() {
if (draining) {
return;
}
var timeout = setTimeout(cleanUpNextTick, 0);
draining = true;
var len = queue.length;
while (len) {
currentQueue = queue;
queue = [];
while (++queueIndex < len) {
if (currentQueue) {
var item = currentQueue[queueIndex];
item.fun.apply(null, item.array);
}
}
queueIndex = -1;
len = queue.length;
}
currentQueue = null;
draining = false;
clearTimeout(timeout, 0);
}
export function nextTick(fun) {
var args = new Array(arguments.length - 1);
if (arguments.length > 1) {
for (var i = 1; i < arguments.length; i++) {
args[i - 1] = arguments[i];
}
}
queue.push({ fun, args });
if (queue.length === 1 && !draining) {
setTimeout(drainQueue, 0);
}
}
export const title = "browser";
export const browser = true;
export const env = {};
export const argv = [];
export const version = ""; // empty string to avoid regexp issues
export const versions = {};
function noop() {}
export const on = noop;
export const addListener = noop;
export const once = noop;
export const off = noop;
export const removeListener = noop;
export const removeAllListeners = noop;
export const emit = noop;
export const prependListener = noop;
export const prependOnceListener = noop;
export const listeners = function (name) {
return [];
};
export const binding = function (name) {
throw new Error("process.binding is not supported in browser polyfill");
};
export const cwd = function () {
return "/";
};
export const chdir = function (dir) {
throw new Error("process.chdir is not supported in browser polyfill");
};
export const umask = function () {
return 0;
};

View File

@@ -1,6 +1,2 @@
/**
* Browser polyfill for the `"punycode"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export * from "punycode";
export * from "./node_modules/punycode";
export { default } from "./node_modules/punycode";

View File

@@ -1,6 +1,3 @@
/**
* Browser polyfill for the `"querystring"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export { decode, default, encode, escape, parse, stringify, unescape, unescapeBuffer } from "querystring-es3";
import querystring_module from "querystring-es3";
export var { unescapeBuffer, unescape, escape, stringify, encode, parse, decode } = querystring_module;
export * as default from "querystring-es3";

View File

@@ -1,7 +1,26 @@
/**
* Browser polyfill for the `"stream"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export * from "readable-stream";
export * as default from "readable-stream";
import stream from "readable-stream";
export const ReadableState = stream.ReadableState;
export const _fromList = stream._fromList;
export const from = stream.from;
export const fromWeb = stream.fromWeb;
export const toWeb = stream.toWeb;
export const wrap = stream.wrap;
export const _uint8ArrayToBuffer = stream._uint8ArrayToBuffer;
export const _isUint8Array = stream._isUint8Array;
export const isDisturbed = stream.isDisturbed;
export const isErrored = stream.isErrored;
export const isReadable = stream.isReadable;
export const Readable = stream.Readable;
export const Writable = stream.Writable;
export const Duplex = stream.Duplex;
export const Transform = stream.Transform;
export const PassThrough = stream.PassThrough;
export const addAbortSignal = stream.addAbortSignal;
export const finished = stream.finished;
export const destroy = stream.destroy;
export const pipeline = stream.pipeline;
export const compose = stream.compose;
export const Stream = stream.Stream;
export default stream;

View File

@@ -1,6 +1,2 @@
/**
* Browser polyfill for the `"string_decoder"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export { StringDecoder, StringDecoder as default } from "string_decoder";
// TODO: This depends on a separate buffer polyfill
export { StringDecoder, StringDecoder as default } from "./node_modules/string_decoder";

View File

@@ -1,7 +1,9 @@
/**
* Browser polyfill for the `"timers"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export * from "timers-browserify";
export * as default from "timers-browserify";
// Hardcoded module "node:timers"
export const setTimeout = globalThis.setTimeout;
export const clearTimeout = globalThis.clearTimeout;
export const setInterval = globalThis.setInterval;
export const setImmediate = globalThis.setImmediate;
export const clearInterval = globalThis.clearInterval;
export const clearImmediate = globalThis.clearImmediate;
export const _unrefActive = () => {};
export * as promises from "node:timers/promises";

View File

@@ -0,0 +1,238 @@
// Hardcoded module "node:timers/promises"
// https://github.com/niksy/isomorphic-timers-promises/blob/master/index.js
const symbolAsyncIterator = /* @__PURE__ */ Symbol.asyncIterator;
class ERR_INVALID_ARG_TYPE extends Error {
constructor(name, expected, actual) {
super(`${name} must be ${expected}, ${typeof actual} given`);
this.code = "ERR_INVALID_ARG_TYPE";
}
}
class AbortError extends Error {
constructor() {
super("The operation was aborted");
this.code = "ABORT_ERR";
}
}
function validateObject(object, name) {
if (object === null || typeof object !== "object") {
throw new ERR_INVALID_ARG_TYPE(name, "Object", object);
}
}
function validateBoolean(value, name) {
if (typeof value !== "boolean") {
throw new ERR_INVALID_ARG_TYPE(name, "boolean", value);
}
}
function validateAbortSignal(signal, name) {
if (typeof signal !== "undefined" && (signal === null || typeof signal !== "object" || !("aborted" in signal))) {
throw new ERR_INVALID_ARG_TYPE(name, "AbortSignal", signal);
}
}
function asyncIterator({ next: nextFunction, return: returnFunction }) {
const result = {};
if (typeof nextFunction === "function") {
result.next = nextFunction;
}
if (typeof returnFunction === "function") {
result.return = returnFunction;
}
result[symbolAsyncIterator] = function () {
return this;
};
return result;
}
function setTimeoutPromise(after = 1, value, options = {}) {
const arguments_ = [].concat(value ?? []);
try {
validateObject(options, "options");
} catch (error) {
return Promise.reject(error);
}
const { signal, ref: reference = true } = options;
try {
validateAbortSignal(signal, "options.signal");
} catch (error) {
return Promise.reject(error);
}
try {
validateBoolean(reference, "options.ref");
} catch (error) {
return Promise.reject(error);
}
if (signal?.aborted) {
return Promise.reject(new AbortError());
}
let onCancel;
const returnValue = new Promise((resolve, reject) => {
const timeout = setTimeout(() => resolve(value), after, ...arguments_);
if (!reference) {
timeout?.unref?.();
}
if (signal) {
onCancel = () => {
clearTimeout(timeout);
reject(new AbortError());
};
signal.addEventListener("abort", onCancel);
}
});
return typeof onCancel !== "undefined"
? returnValue.finally(() => signal.removeEventListener("abort", onCancel))
: returnValue;
}
function setImmediatePromise(value, options = {}) {
try {
validateObject(options, "options");
} catch (error) {
return Promise.reject(error);
}
const { signal, ref: reference = true } = options;
try {
validateAbortSignal(signal, "options.signal");
} catch (error) {
return Promise.reject(error);
}
try {
validateBoolean(reference, "options.ref");
} catch (error) {
return Promise.reject(error);
}
if (signal?.aborted) {
return Promise.reject(new AbortError());
}
let onCancel;
const returnValue = new Promise((resolve, reject) => {
const immediate = setImmediate(() => resolve(value));
if (!reference) {
immediate?.unref?.();
}
if (signal) {
onCancel = () => {
clearImmediate(immediate);
reject(new AbortError());
};
signal.addEventListener("abort", onCancel);
}
});
return typeof onCancel !== "undefined"
? returnValue.finally(() => signal.removeEventListener("abort", onCancel))
: returnValue;
}
function setIntervalPromise(after = 1, value, options = {}) {
/* eslint-disable no-undefined, no-unreachable-loop, no-loop-func */
try {
validateObject(options, "options");
} catch (error) {
return asyncIterator({
next: function () {
return Promise.reject(error);
},
});
}
const { signal, ref: reference = true } = options;
try {
validateAbortSignal(signal, "options.signal");
} catch (error) {
return asyncIterator({
next: function () {
return Promise.reject(error);
},
});
}
try {
validateBoolean(reference, "options.ref");
} catch (error) {
return asyncIterator({
next: function () {
return Promise.reject(error);
},
});
}
if (signal?.aborted) {
return asyncIterator({
next: function () {
return Promise.reject(new AbortError());
},
});
}
let onCancel, interval;
try {
let notYielded = 0;
let callback;
interval = setInterval(() => {
notYielded++;
if (callback) {
callback();
callback = undefined;
}
}, after);
if (!reference) {
interval?.unref?.();
}
if (signal) {
onCancel = () => {
clearInterval(interval);
if (callback) {
callback();
callback = undefined;
}
};
signal.addEventListener("abort", onCancel);
}
return asyncIterator({
next: function () {
return new Promise((resolve, reject) => {
if (!signal?.aborted) {
if (notYielded === 0) {
callback = resolve;
} else {
resolve();
}
} else if (notYielded === 0) {
reject(new AbortError());
} else {
resolve();
}
}).then(() => {
if (notYielded > 0) {
notYielded = notYielded - 1;
return { done: false, value: value };
}
return { done: true };
});
},
return: function () {
clearInterval(interval);
signal?.removeEventListener("abort", onCancel);
return Promise.resolve({});
},
});
} catch (error) {
return asyncIterator({
next: function () {
clearInterval(interval);
signal?.removeEventListener("abort", onCancel);
},
});
}
}
export { setImmediatePromise as setImmediate, setIntervalPromise as setInterval, setTimeoutPromise as setTimeout };
export const scheduler = {
wait: (delay, options) => setTimeoutPromise(delay, undefined, options),
yield: setImmediatePromise,
};

View File

@@ -1,8 +1,3 @@
/**
* Browser polyfill for the `"tty"` module.
*
* Imported on usage in `bun build --target=browser`
*/
let isatty = () => false;
function WriteStream() {
throw new Error("tty.WriteStream is not implemented for browsers");
@@ -11,4 +6,3 @@ function ReadStream() {
throw new Error("tty.ReadStream is not implemented for browsers");
}
export { ReadStream, WriteStream, isatty };
export default { isatty, ReadStream, WriteStream };

View File

@@ -1,9 +1,3 @@
/**
* Browser polyfill for the `"url"` module.
*
* Imported on usage in `bun build --target=browser`
*/
// -----------------------------------------------------------------------------
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
@@ -26,7 +20,8 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
"use strict";
const { URL, URLSearchParams } = globalThis;
const URL = /* @__PURE__ */ globalThis.URL;
const URLSearchParams = /* @__PURE__ */ globalThis.URLSearchParams;
function util_isString(arg) {
return typeof arg === "string";
@@ -40,9 +35,6 @@ function util_isNull(arg) {
function util_isNullOrUndefined(arg) {
return arg == null;
}
function util_isUndefined(arg) {
return arg === void 0;
}
function Url() {
this.protocol = null;

View File

@@ -1,12 +1,949 @@
// NOTE: THIS IS A BROWSER POLYFILL - Bun's actual node:* modules are in src/js/node
//
// This file is derived from https://www.npmjs.com/package/util v0.12.5,
// converted into an Tree-shaking ES Module.
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var formatRegExp = /%[sdj%]/g;
export function format(f, ...args) {
if (!isString(f)) {
var objects = [f];
for (var i = 0; i < args.length; i++) {
objects.push(inspect(args[i]));
}
return objects.join(" ");
}
var i = 0;
var len = args.length;
var str = String(f).replace(formatRegExp, function (x) {
if (x === "%%") return "%";
if (i >= len) return x;
switch (x) {
case "%s":
return String(args[i++]);
case "%d":
return Number(args[i++]);
case "%j":
try {
return JSON.stringify(args[i++]);
} catch (_) {
return "[Circular]";
}
default:
return x;
}
});
for (var x = args[i]; i < len; x = args[++i]) {
if (isNull(x) || !isObject(x)) {
str += " " + x;
} else {
str += " " + inspect(x);
}
}
return str;
}
// Mark that a method should not be used.
// Returns a modified function which warns once by default.
// If --no-deprecation is set, then it is a no-op.
export function deprecate(fn, msg) {
if (typeof process === "undefined" || process?.noDeprecation === true) {
return fn;
}
var warned = false;
function deprecated(...args) {
if (!warned) {
if (process.throwDeprecation) {
throw new Error(msg);
} else if (process.traceDeprecation) {
console.trace(msg);
} else {
console.error(msg);
}
warned = true;
}
return fn.apply(this, ...args);
}
return deprecated;
}
// This function has been edited to be tree-shakable and minifiable
export const debuglog = /* @__PURE__ */ ((debugs = {}, debugEnvRegex = {}, debugEnv) => (
((debugEnv = typeof process !== "undefined" && process.env.NODE_DEBUG) &&
(debugEnv = debugEnv
.replace(/[|\\{}()[\]^$+?.]/g, "\\$&")
.replace(/\*/g, ".*")
.replace(/,/g, "$|^")
.toUpperCase()),
(debugEnvRegex = new RegExp("^" + debugEnv + "$", "i"))),
set => {
set = set.toUpperCase();
if (!debugs[set]) {
if (debugEnvRegex.test(set)) {
debugs[set] = function (...args) {
console.error("%s: %s", set, pid, format.apply(null, ...args));
};
} else {
debugs[set] = function () {};
}
}
return debugs[set];
}
))();
/**
* Browser polyfill for the `"util"` module.
* Echos the value of a value. Tries to print the value out
* in the best way possible given the different types.
*
* Imported on usage in `bun build --target=browser`
* @param {Object} obj The object to print out.
* @param {Object} opts Optional options object that alters the output.
*/
export * from "util";
/* legacy: obj, showHidden, depth, colors*/
export const inspect = /* @__PURE__ */ (i =>
(
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
(i.colors = {
"bold": [1, 22],
"italic": [3, 23],
"underline": [4, 24],
"inverse": [7, 27],
"white": [37, 39],
"grey": [90, 39],
"black": [30, 39],
"blue": [34, 39],
"cyan": [36, 39],
"green": [32, 39],
"magenta": [35, 39],
"red": [31, 39],
"yellow": [33, 39],
}),
// Don't use 'blue' not visible on cmd.exe
(i.styles = {
"special": "cyan",
"number": "yellow",
"boolean": "yellow",
"undefined": "grey",
"null": "bold",
"string": "green",
"date": "magenta",
// "name": intentionally not styling
"regexp": "red",
}),
(i.custom = Symbol.for("nodejs.util.inspect.custom")),
i
))(function inspect(obj, opts, ...rest) {
// default options
var ctx = {
seen: [],
stylize: stylizeNoColor,
};
// legacy...
if (rest.length >= 1) ctx.depth = rest[0];
if (rest.length >= 2) ctx.colors = rest[1];
if (isBoolean(opts)) {
// legacy...
ctx.showHidden = opts;
} else if (opts) {
// got an "options" object
_extend(ctx, opts);
}
// set default options
if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
if (isUndefined(ctx.depth)) ctx.depth = 2;
if (isUndefined(ctx.colors)) ctx.colors = false;
if (ctx.colors) ctx.stylize = stylizeWithColor;
return formatValue(ctx, obj, ctx.depth);
});
const TextEncoder = globalThis.TextEncoder;
const TextDecoder = globalThis.TextDecoder;
function stylizeWithColor(str, styleType) {
var style = inspect.styles[styleType];
export { TextDecoder, TextEncoder };
export default { TextEncoder, TextDecoder };
if (style) {
return "\u001b[" + inspect.colors[style][0] + "m" + str + "\u001b[" + inspect.colors[style][1] + "m";
} else {
return str;
}
}
function stylizeNoColor(str, styleType) {
return str;
}
function arrayToHash(array) {
var hash = {};
array.forEach(function (val, idx) {
hash[val] = true;
});
return hash;
}
function formatValue(ctx, value, recurseTimes) {
// Provide a hook for user-specified inspect functions.
// Check that value is an object with an inspect function on it
if (
ctx.customInspect &&
value &&
isFunction(value.inspect) &&
// Filter out the util module, it's inspect function is special
value.inspect !== inspect &&
// Also filter out any prototype objects using the circular check.
!(value.constructor && value.constructor.prototype === value)
) {
var ret = value.inspect(recurseTimes, ctx);
if (!isString(ret)) {
ret = formatValue(ctx, ret, recurseTimes);
}
return ret;
}
// Primitive types cannot have properties
var primitive = formatPrimitive(ctx, value);
if (primitive) {
return primitive;
}
// Look up the keys of the object.
var keys = Object.keys(value);
var visibleKeys = arrayToHash(keys);
if (ctx.showHidden) {
keys = Object.getOwnPropertyNames(value);
}
// IE doesn't make error fields non-enumerable
// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) {
return formatError(value);
}
// Some type of object without properties can be shortcutted.
if (keys.length === 0) {
if (isFunction(value)) {
var name = value.name ? ": " + value.name : "";
return ctx.stylize("[Function" + name + "]", "special");
}
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
}
if (isDate(value)) {
return ctx.stylize(Date.prototype.toString.call(value), "date");
}
if (isError(value)) {
return formatError(value);
}
}
var base = "",
array = false,
braces = ["{", "}"];
// Make Array say that they are Array
if (isArray(value)) {
array = true;
braces = ["[", "]"];
}
// Make functions say that they are functions
if (isFunction(value)) {
var n = value.name ? ": " + value.name : "";
base = " [Function" + n + "]";
}
// Make RegExps say that they are RegExps
if (isRegExp(value)) {
base = " " + RegExp.prototype.toString.call(value);
}
// Make dates with properties first say the date
if (isDate(value)) {
base = " " + Date.prototype.toUTCString.call(value);
}
// Make error with message first say the error
if (isError(value)) {
base = " " + formatError(value);
}
if (keys.length === 0 && (!array || value.length == 0)) {
return braces[0] + base + braces[1];
}
if (recurseTimes < 0) {
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), "regexp");
} else {
return ctx.stylize("[Object]", "special");
}
}
ctx.seen.push(value);
var output;
if (array) {
output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
} else {
output = keys.map(function (key) {
return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
});
}
ctx.seen.pop();
return reduceToSingleString(output, base, braces);
}
function formatPrimitive(ctx, value) {
if (isUndefined(value)) return ctx.stylize("undefined", "undefined");
if (isString(value)) {
var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
return ctx.stylize(simple, "string");
}
if (isNumber(value)) return ctx.stylize("" + value, "number");
if (isBoolean(value)) return ctx.stylize("" + value, "boolean");
// For some reason typeof null is "object", so special case here.
if (isNull(value)) return ctx.stylize("null", "null");
}
function formatError(value) {
return "[" + Error.prototype.toString.call(value) + "]";
}
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
var output = [];
for (var i = 0, l = value.length; i < l; ++i) {
if (hasOwnProperty(value, String(i))) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
} else {
output.push("");
}
}
keys.forEach(function (key) {
if (!key.match(/^\d+$/)) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
}
});
return output;
}
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
var name, str, desc;
desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
if (desc.get) {
if (desc.set) {
str = ctx.stylize("[Getter/Setter]", "special");
} else {
str = ctx.stylize("[Getter]", "special");
}
} else {
if (desc.set) {
str = ctx.stylize("[Setter]", "special");
}
}
if (!hasOwnProperty(visibleKeys, key)) {
name = "[" + key + "]";
}
if (!str) {
if (ctx.seen.indexOf(desc.value) < 0) {
if (isNull(recurseTimes)) {
str = formatValue(ctx, desc.value, null);
} else {
str = formatValue(ctx, desc.value, recurseTimes - 1);
}
if (str.indexOf("\n") > -1) {
if (array) {
str = str
.split("\n")
.map(function (line) {
return " " + line;
})
.join("\n")
.slice(2);
} else {
str =
"\n" +
str
.split("\n")
.map(function (line) {
return " " + line;
})
.join("\n");
}
}
} else {
str = ctx.stylize("[Circular]", "special");
}
}
if (isUndefined(name)) {
if (array && key.match(/^\d+$/)) {
return str;
}
name = JSON.stringify("" + key);
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
name = name.slice(1, -1);
name = ctx.stylize(name, "name");
} else {
name = name
.replace(/'/g, "\\'")
.replace(/\\"/g, '"')
.replace(/(^"|"$)/g, "'");
name = ctx.stylize(name, "string");
}
}
return name + ": " + str;
}
function reduceToSingleString(output, base, braces) {
var numLinesEst = 0;
var length = output.reduce(function (prev, cur) {
numLinesEst++;
if (cur.indexOf("\n") >= 0) numLinesEst++;
return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1;
}, 0);
if (length > 60) {
return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n ") + " " + braces[1];
}
return braces[0] + base + " " + output.join(", ") + " " + braces[1];
}
// NOTE: These type checking functions intentionally don't use `instanceof`
// because it is fragile and can be easily faked with `Object.create()`.
export const types = /* @__PURE__ */ () => {
// var toStr = Object.prototype.toString;
// var fnToStr = Function.prototype.toString;
// function isArgumentsObject(value) {
// if (hasToStringTag && value && typeof value === "object" && Symbol.toStringTag in value) {
// return false;
// }
// return toStr.apply(value) === "[object Arguments]";
// }
// var isFnRegex = /^\s*(?:function)?\*/;
// var getProto = Object.getPrototypeOf;
// var GeneratorFunction;
// function isGeneratorFunction(fn) {
// if (typeof fn !== "function") {
// return false;
// }
// if (isFnRegex.test(fnToStr.call(fn))) {
// return true;
// }
// if (typeof GeneratorFunction === "undefined") {
// var generatorFunc;
// try {
// generatorFunc = Function("return function*() {}")();
// } catch (e) {}
// GeneratorFunction = generatorFunc ? getProto(generatorFunc) : false;
// }
// return getProto(fn) === GeneratorFunction;
// }
// // var whichTypedArray = require("which-typed-array");
// // var isTypedArray = require("is-typed-array");
// function uncurryThis(f) {
// return f.call.bind(f);
// }
// var BigIntSupported = typeof BigInt !== "undefined";
// var SymbolSupported = typeof Symbol !== "undefined";
// var ObjectToString = uncurryThis(Object.prototype.toString);
// var numberValue = uncurryThis(Number.prototype.valueOf);
// var stringValue = uncurryThis(String.prototype.valueOf);
// var booleanValue = uncurryThis(Boolean.prototype.valueOf);
// if (BigIntSupported) {
// var bigIntValue = uncurryThis(BigInt.prototype.valueOf);
// }
// if (SymbolSupported) {
// var symbolValue = uncurryThis(Symbol.prototype.valueOf);
// }
// function checkBoxedPrimitive(value, prototypeValueOf) {
// if (typeof value !== "object") {
// return false;
// }
// try {
// prototypeValueOf(value);
// return true;
// } catch (e) {
// return false;
// }
// }
// exports.isArgumentsObject = isArgumentsObject;
// exports.isGeneratorFunction = isGeneratorFunction;
// exports.isTypedArray = isTypedArray;
// // Taken from here and modified for better browser support
// // https://github.com/sindresorhus/p-is-promise/blob/cda35a513bda03f977ad5cde3a079d237e82d7ef/index.js
// function isPromise(input) {
// return (
// (typeof Promise !== "undefined" && input instanceof Promise) ||
// (input !== null &&
// typeof input === "object" &&
// typeof input.then === "function" &&
// typeof input.catch === "function")
// );
// }
// exports.isPromise = isPromise;
// function isArrayBufferView(value) {
// if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
// return ArrayBuffer.isView(value);
// }
// return isTypedArray(value) || isDataView(value);
// }
// exports.isArrayBufferView = isArrayBufferView;
// function isUint8Array(value) {
// return whichTypedArray(value) === "Uint8Array";
// }
// exports.isUint8Array = isUint8Array;
// function isUint8ClampedArray(value) {
// return whichTypedArray(value) === "Uint8ClampedArray";
// }
// exports.isUint8ClampedArray = isUint8ClampedArray;
// function isUint16Array(value) {
// return whichTypedArray(value) === "Uint16Array";
// }
// exports.isUint16Array = isUint16Array;
// function isUint32Array(value) {
// return whichTypedArray(value) === "Uint32Array";
// }
// exports.isUint32Array = isUint32Array;
// function isInt8Array(value) {
// return whichTypedArray(value) === "Int8Array";
// }
// exports.isInt8Array = isInt8Array;
// function isInt16Array(value) {
// return whichTypedArray(value) === "Int16Array";
// }
// exports.isInt16Array = isInt16Array;
// function isInt32Array(value) {
// return whichTypedArray(value) === "Int32Array";
// }
// exports.isInt32Array = isInt32Array;
// function isFloat32Array(value) {
// return whichTypedArray(value) === "Float32Array";
// }
// exports.isFloat32Array = isFloat32Array;
// function isFloat64Array(value) {
// return whichTypedArray(value) === "Float64Array";
// }
// exports.isFloat64Array = isFloat64Array;
// function isBigInt64Array(value) {
// return whichTypedArray(value) === "BigInt64Array";
// }
// exports.isBigInt64Array = isBigInt64Array;
// function isBigUint64Array(value) {
// return whichTypedArray(value) === "BigUint64Array";
// }
// exports.isBigUint64Array = isBigUint64Array;
// function isMapToString(value) {
// return ObjectToString(value) === "[object Map]";
// }
// isMapToString.working = typeof Map !== "undefined" && isMapToString(new Map());
// function isMap(value) {
// if (typeof Map === "undefined") {
// return false;
// }
// return isMapToString.working ? isMapToString(value) : value instanceof Map;
// }
// exports.isMap = isMap;
// function isSetToString(value) {
// return ObjectToString(value) === "[object Set]";
// }
// isSetToString.working = typeof Set !== "undefined" && isSetToString(new Set());
// function isSet(value) {
// if (typeof Set === "undefined") {
// return false;
// }
// return isSetToString.working ? isSetToString(value) : value instanceof Set;
// }
// exports.isSet = isSet;
// function isWeakMapToString(value) {
// return ObjectToString(value) === "[object WeakMap]";
// }
// isWeakMapToString.working = typeof WeakMap !== "undefined" && isWeakMapToString(new WeakMap());
// function isWeakMap(value) {
// if (typeof WeakMap === "undefined") {
// return false;
// }
// return isWeakMapToString.working ? isWeakMapToString(value) : value instanceof WeakMap;
// }
// exports.isWeakMap = isWeakMap;
// function isWeakSetToString(value) {
// return ObjectToString(value) === "[object WeakSet]";
// }
// isWeakSetToString.working = typeof WeakSet !== "undefined" && isWeakSetToString(new WeakSet());
// function isWeakSet(value) {
// return isWeakSetToString(value);
// }
// exports.isWeakSet = isWeakSet;
// function isArrayBufferToString(value) {
// return ObjectToString(value) === "[object ArrayBuffer]";
// }
// isArrayBufferToString.working = typeof ArrayBuffer !== "undefined" && isArrayBufferToString(new ArrayBuffer());
// function isArrayBuffer(value) {
// if (typeof ArrayBuffer === "undefined") {
// return false;
// }
// return isArrayBufferToString.working ? isArrayBufferToString(value) : value instanceof ArrayBuffer;
// }
// exports.isArrayBuffer = isArrayBuffer;
// function isDataViewToString(value) {
// return ObjectToString(value) === "[object DataView]";
// }
// isDataViewToString.working =
// typeof ArrayBuffer !== "undefined" &&
// typeof DataView !== "undefined" &&
// isDataViewToString(new DataView(new ArrayBuffer(1), 0, 1));
// function isDataView(value) {
// if (typeof DataView === "undefined") {
// return false;
// }
// return isDataViewToString.working ? isDataViewToString(value) : value instanceof DataView;
// }
// exports.isDataView = isDataView;
// // Store a copy of SharedArrayBuffer in case it's deleted elsewhere
// var SharedArrayBufferCopy = typeof SharedArrayBuffer !== "undefined" ? SharedArrayBuffer : undefined;
// function isSharedArrayBufferToString(value) {
// return ObjectToString(value) === "[object SharedArrayBuffer]";
// }
// function isSharedArrayBuffer(value) {
// if (typeof SharedArrayBufferCopy === "undefined") {
// return false;
// }
// if (typeof isSharedArrayBufferToString.working === "undefined") {
// isSharedArrayBufferToString.working = isSharedArrayBufferToString(new SharedArrayBufferCopy());
// }
// return isSharedArrayBufferToString.working
// ? isSharedArrayBufferToString(value)
// : value instanceof SharedArrayBufferCopy;
// }
// exports.isSharedArrayBuffer = isSharedArrayBuffer;
// function isAsyncFunction(value) {
// return ObjectToString(value) === "[object AsyncFunction]";
// }
// exports.isAsyncFunction = isAsyncFunction;
// function isMapIterator(value) {
// return ObjectToString(value) === "[object Map Iterator]";
// }
// exports.isMapIterator = isMapIterator;
// function isSetIterator(value) {
// return ObjectToString(value) === "[object Set Iterator]";
// }
// exports.isSetIterator = isSetIterator;
// function isGeneratorObject(value) {
// return ObjectToString(value) === "[object Generator]";
// }
// exports.isGeneratorObject = isGeneratorObject;
// function isWebAssemblyCompiledModule(value) {
// return ObjectToString(value) === "[object WebAssembly.Module]";
// }
// exports.isWebAssemblyCompiledModule = isWebAssemblyCompiledModule;
// function isNumberObject(value) {
// return checkBoxedPrimitive(value, numberValue);
// }
// exports.isNumberObject = isNumberObject;
// function isStringObject(value) {
// return checkBoxedPrimitive(value, stringValue);
// }
// exports.isStringObject = isStringObject;
// function isBooleanObject(value) {
// return checkBoxedPrimitive(value, booleanValue);
// }
// exports.isBooleanObject = isBooleanObject;
// function isBigIntObject(value) {
// return BigIntSupported && checkBoxedPrimitive(value, bigIntValue);
// }
// exports.isBigIntObject = isBigIntObject;
// function isSymbolObject(value) {
// return SymbolSupported && checkBoxedPrimitive(value, symbolValue);
// }
// exports.isSymbolObject = isSymbolObject;
// function isBoxedPrimitive(value) {
// return (
// isNumberObject(value) ||
// isStringObject(value) ||
// isBooleanObject(value) ||
// isBigIntObject(value) ||
// isSymbolObject(value)
// );
// }
// exports.isBoxedPrimitive = isBoxedPrimitive;
// function isAnyArrayBuffer(value) {
// return typeof Uint8Array !== "undefined" && (isArrayBuffer(value) || isSharedArrayBuffer(value));
// }
// exports.isAnyArrayBuffer = isAnyArrayBuffer;
// ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function (method) {
// Object.defineProperty(exports, method, {
// enumerable: false,
// value: function () {
// throw new Error(method + " is not supported in userland");
// },
// });
// });
// exports.types.isRegExp = isRegExp;
// exports.types.isDate = isDate;
// exports.types.isNativeError = isError;
};
export function isArray(ar) {
return Array.isArray(ar);
}
export function isBoolean(arg) {
return typeof arg === "boolean";
}
export function isNull(arg) {
return arg === null;
}
export function isNullOrUndefined(arg) {
return arg == null;
}
export function isNumber(arg) {
return typeof arg === "number";
}
export function isString(arg) {
return typeof arg === "string";
}
export function isSymbol(arg) {
return typeof arg === "symbol";
}
export function isUndefined(arg) {
return arg === void 0;
}
export function isRegExp(re) {
return isObject(re) && objectToString(re) === "[object RegExp]";
}
export function isObject(arg) {
return typeof arg === "object" && arg !== null;
}
export function isDate(d) {
return isObject(d) && objectToString(d) === "[object Date]";
}
export function isError(e) {
return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error);
}
export function isFunction(arg) {
return typeof arg === "function";
}
export function isPrimitive(arg) {
return (
arg === null ||
typeof arg === "boolean" ||
typeof arg === "number" ||
typeof arg === "string" ||
typeof arg === "symbol" || // ES6 symbol
typeof arg === "undefined"
);
}
// Compatibility with the buffer polyfill:
export function isBuffer(arg) {
return arg instanceof Buffer;
}
function objectToString(o) {
return Object.prototype.toString.call(o);
}
function pad(n) {
return n < 10 ? "0" + n.toString(10) : n.toString(10);
}
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
// 26 Feb 16:19:34
function timestamp() {
var d = new Date();
var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(":");
return [d.getDate(), months[d.getMonth()], time].join(" ");
}
// log is just a thin wrapper to console.log that prepends a timestamp
export function log(...args) {
console.log("%s - %s", timestamp(), format.apply(null, args));
}
/**
* Inherit the prototype methods from one constructor into another.
*
* The Function.prototype.inherits from lang.js rewritten as a standalone
* function (not on Function.prototype). NOTE: If this file is to be loaded
* during bootstrapping this function needs to be rewritten using some native
* functions as prototype setup using normal JavaScript does not work as
* expected during bootstrapping (see mirror.js in r114903).
*
* @param {function} ctor Constructor function which needs to inherit the
* prototype.
* @param {function} superCtor Constructor function to inherit prototype from.
*/
export function inherits(ctor, superCtor) {
if (superCtor) {
ctor.super_ = superCtor;
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true,
},
});
}
}
export function _extend(origin, add) {
// Don't do anything if add isn't an object
if (!add || !isObject(add)) return origin;
var keys = Object.keys(add);
var i = keys.length;
while (i--) {
origin[keys[i]] = add[keys[i]];
}
return origin;
}
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
export const promisify = /* @__PURE__ */ (x => ((x.custom = Symbol.for("nodejs.util.promisify.custom")), x))(
function promisify(original) {
if (typeof original !== "function") throw new TypeError('The "original" argument must be of type Function');
if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {
var fn = original[kCustomPromisifiedSymbol];
if (typeof fn !== "function") {
throw new TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');
}
Object.defineProperty(fn, kCustomPromisifiedSymbol, {
value: fn,
enumerable: false,
writable: false,
configurable: true,
});
return fn;
}
function fn(...args) {
var promiseResolve, promiseReject;
var promise = new Promise(function (resolve, reject) {
promiseResolve = resolve;
promiseReject = reject;
});
args.push(function (err, value) {
if (err) {
promiseReject(err);
} else {
promiseResolve(value);
}
});
try {
original.apply(this, args);
} catch (err) {
promiseReject(err);
}
return promise;
}
Object.setPrototypeOf(fn, Object.getPrototypeOf(original));
if (kCustomPromisifiedSymbol)
Object.defineProperty(fn, kCustomPromisifiedSymbol, {
value: fn,
enumerable: false,
writable: false,
configurable: true,
});
return Object.defineProperties(fn, Object.getOwnPropertyDescriptors(original));
},
);
export function callbackifyOnRejected(reason, cb) {
// `!reason` guard inspired by bluebird (Ref: https://goo.gl/t5IS6M).
// Because `null` is a special error value in callbacks which means "no error
// occurred", we error-wrap so the callback consumer can distinguish between
// "the promise rejected with null" or "the promise fulfilled with undefined".
if (!reason) {
var newReason = new Error("Promise was rejected with a falsy value");
newReason.reason = reason;
reason = newReason;
}
return cb(reason);
}
export function callbackify(original) {
if (typeof original !== "function") {
throw new TypeError('The "original" argument must be of type Function');
}
// We DO NOT return the promise as it gives the user a false sense that
// the promise is actually somehow related to the callback's execution
// and that the callback throwing will reject the promise.
function callbackified(...args) {
var maybeCb = args.pop();
if (typeof maybeCb !== "function") {
throw new TypeError("The last argument must be of type Function");
}
var self = this;
var cb = function (...args) {
return maybeCb.apply(self, ...args);
};
// In true node style we process the callback on `nextTick` with all the
// implications (stack, `uncaughtException`, `async_hooks`)
original.apply(this, args).then(
function (ret) {
process.nextTick(cb.bind(null, null, ret));
},
function (rej) {
process.nextTick(callbackifyOnRejected.bind(null, rej, cb));
},
);
}
Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original));
Object.defineProperties(callbackified, Object.getOwnPropertyDescriptors(original));
return callbackified;
}
export const TextEncoder = /* @__PURE__ */ globalThis.TextEncoder;
export const TextDecoder = /* @__PURE__ */ globalThis.TextDecoder;

126
src/node-fallbacks/vendor/base64-js.js vendored Normal file
View File

@@ -0,0 +1,126 @@
// Vendored version of https://www.npmjs.com/package/base64-js version 1.5.1
// Converted manually to an ES module for higher tree-shaking compatibility
"use strict";
var lookup = [];
var revLookup = [];
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
for (var i = 0, len = code.length; i < len; ++i) {
lookup[i] = code[i];
revLookup[code.charCodeAt(i)] = i;
}
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup["-".charCodeAt(0)] = 62;
revLookup["_".charCodeAt(0)] = 63;
function getLens(b64) {
var len = b64.length;
if (len % 4 > 0) {
throw new Error("Invalid string. Length must be a multiple of 4");
}
// Trim off extra bytes after placeholder bytes are found
// See: https://github.com/beatgammit/base64-js/issues/42
var validLen = b64.indexOf("=");
if (validLen === -1) validLen = len;
var placeHoldersLen = validLen === len ? 0 : 4 - (validLen % 4);
return [validLen, placeHoldersLen];
}
// base64 is 4/3 + up to two characters of the original data
function byteLength(b64) {
var lens = getLens(b64);
var validLen = lens[0];
var placeHoldersLen = lens[1];
return ((validLen + placeHoldersLen) * 3) / 4 - placeHoldersLen;
}
function _byteLength(validLen, placeHoldersLen) {
return ((validLen + placeHoldersLen) * 3) / 4 - placeHoldersLen;
}
export function toByteArray(b64) {
var tmp;
var lens = getLens(b64);
var validLen = lens[0];
var placeHoldersLen = lens[1];
var arr = new Uint8Array(_byteLength(validLen, placeHoldersLen));
var curByte = 0;
// if there are placeholders, only get up to the last complete 4 chars
var len = placeHoldersLen > 0 ? validLen - 4 : validLen;
var i;
for (i = 0; i < len; i += 4) {
tmp =
(revLookup[b64.charCodeAt(i)] << 18) |
(revLookup[b64.charCodeAt(i + 1)] << 12) |
(revLookup[b64.charCodeAt(i + 2)] << 6) |
revLookup[b64.charCodeAt(i + 3)];
arr[curByte++] = (tmp >> 16) & 0xff;
arr[curByte++] = (tmp >> 8) & 0xff;
arr[curByte++] = tmp & 0xff;
}
if (placeHoldersLen === 2) {
tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4);
arr[curByte++] = tmp & 0xff;
}
if (placeHoldersLen === 1) {
tmp =
(revLookup[b64.charCodeAt(i)] << 10) |
(revLookup[b64.charCodeAt(i + 1)] << 4) |
(revLookup[b64.charCodeAt(i + 2)] >> 2);
arr[curByte++] = (tmp >> 8) & 0xff;
arr[curByte++] = tmp & 0xff;
}
return arr;
}
function tripletToBase64(num) {
return lookup[(num >> 18) & 0x3f] + lookup[(num >> 12) & 0x3f] + lookup[(num >> 6) & 0x3f] + lookup[num & 0x3f];
}
function encodeChunk(uint8, start, end) {
var tmp;
var output = [];
for (var i = start; i < end; i += 3) {
tmp = ((uint8[i] << 16) & 0xff0000) + ((uint8[i + 1] << 8) & 0xff00) + (uint8[i + 2] & 0xff);
output.push(tripletToBase64(tmp));
}
return output.join("");
}
export function fromByteArray(uint8) {
var tmp;
var len = uint8.length;
var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
var parts = [];
var maxChunkLength = 16383; // must be multiple of 3
// go through the array every three bytes, we'll deal with trailing stuff later
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
}
// pad the end with zeros, but make sure to not forget the extra bytes
if (extraBytes === 1) {
tmp = uint8[len - 1];
parts.push(lookup[tmp >> 2] + lookup[(tmp << 4) & 0x3f] + "==");
} else if (extraBytes === 2) {
tmp = (uint8[len - 2] << 8) + uint8[len - 1];
parts.push(lookup[tmp >> 10] + lookup[(tmp >> 4) & 0x3f] + lookup[(tmp << 2) & 0x3f] + "=");
}
return parts.join("");
}

85
src/node-fallbacks/vendor/ieee754.js vendored Normal file
View File

@@ -0,0 +1,85 @@
/* ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
export function read(buffer, offset, isLE, mLen, nBytes) {
var e, m;
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var nBits = -7;
var i = isLE ? nBytes - 1 : 0;
var d = isLE ? -1 : 1;
var s = buffer[offset + i];
i += d;
e = s & ((1 << -nBits) - 1);
s >>= -nBits;
nBits += eLen;
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
m = e & ((1 << -nBits) - 1);
e >>= -nBits;
nBits += mLen;
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
if (e === 0) {
e = 1 - eBias;
} else if (e === eMax) {
return m ? NaN : (s ? -1 : 1) * Infinity;
} else {
m = m + Math.pow(2, mLen);
e = e - eBias;
}
return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
}
export function write(buffer, value, offset, isLE, mLen, nBytes) {
var e, m, c;
var eLen = nBytes * 8 - mLen - 1;
var eMax = (1 << eLen) - 1;
var eBias = eMax >> 1;
var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
var i = isLE ? 0 : nBytes - 1;
var d = isLE ? 1 : -1;
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
value = Math.abs(value);
if (isNaN(value) || value === Infinity) {
m = isNaN(value) ? 1 : 0;
e = eMax;
} else {
e = Math.floor(Math.log(value) / Math.LN2);
if (value * (c = Math.pow(2, -e)) < 1) {
e--;
c *= 2;
}
if (e + eBias >= 1) {
value += rt / c;
} else {
value += rt * Math.pow(2, 1 - eBias);
}
if (value * c >= 2) {
e++;
c /= 2;
}
if (e + eBias >= eMax) {
m = 0;
e = eMax;
} else if (e + eBias >= 1) {
m = (value * c - 1) * Math.pow(2, mLen);
e = e + eBias;
} else {
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
e = 0;
}
}
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
e = (e << mLen) | m;
eLen += mLen;
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
buffer[offset + i - d] |= s * 128;
}

View File

@@ -1,7 +1,2 @@
/**
* Browser polyfill for the `"zlib"` module.
*
* Imported on usage in `bun build --target=browser`
*/
export * from "browserify-zlib";
export * as default from "browserify-zlib";
export { default } from "browserify-zlib";

File diff suppressed because one or more lines are too long