aboutsummaryrefslogtreecommitdiff
path: root/src/js
diff options
context:
space:
mode:
authorGravatar dave caruso <me@paperdave.net> 2023-08-17 20:56:52 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-17 20:56:52 -0700
commit6fd0043f6bf766cc488a88339059e8879fa07161 (patch)
treed5289bcaf0880a3bf1e2f0b1c681aff93188fe51 /src/js
parent0424fd8f6e7549ed779788006acdc97a8467e287 (diff)
downloadbun-6fd0043f6bf766cc488a88339059e8879fa07161.tar.gz
bun-6fd0043f6bf766cc488a88339059e8879fa07161.tar.zst
bun-6fd0043f6bf766cc488a88339059e8879fa07161.zip
Add `util.inspect.custom` support to `util.inspect/Bun.inspect/console.log` (#4194)
* start work on util.inspect.custom * asdf * finish util inspect custom inspect * inspect * fix tests * revert * tidy * revert * oops * test * fix issues
Diffstat (limited to 'src/js')
-rw-r--r--src/js/builtins/UtilInspect.ts17
-rw-r--r--src/js/node/util.js53
-rw-r--r--src/js/out/InternalModuleRegistryConstants.h6
-rw-r--r--src/js/out/WebCoreJSBuiltins.cpp26
-rw-r--r--src/js/out/WebCoreJSBuiltins.h92
5 files changed, 173 insertions, 21 deletions
diff --git a/src/js/builtins/UtilInspect.ts b/src/js/builtins/UtilInspect.ts
new file mode 100644
index 000000000..586f03b57
--- /dev/null
+++ b/src/js/builtins/UtilInspect.ts
@@ -0,0 +1,17 @@
+type Inspect = typeof import("util").inspect;
+
+// This is passed to [util.inspect.custom](..., { stylize }) to help users colorize parts.
+export function getStylizeWithColor(inspect: Inspect) {
+ return function stylizeWithColor(str: string, styleType: string) {
+ const style = inspect.styles[styleType];
+ if (style !== undefined) {
+ const color = inspect.colors[style];
+ if (color !== undefined) return `\u001b[${color[0]}m${str}\u001b[${color[1]}m`;
+ }
+ return str;
+ };
+}
+
+export function stylizeWithNoColor(str: string) {
+ return str;
+}
diff --git a/src/js/node/util.js b/src/js/node/util.js
index 2a3bbfad1..10dc95e2e 100644
--- a/src/js/node/util.js
+++ b/src/js/node/util.js
@@ -123,6 +123,7 @@ function debuglog(set) {
}
return debugs[set];
}
+var kInspectCustom = Symbol.for("nodejs.util.inspect.custom");
function inspect(obj, opts) {
var ctx = {
seen: [],
@@ -167,13 +168,29 @@ inspect.styles = {
date: "magenta",
regexp: "red",
};
+inspect.custom = kInspectCustom;
+// JS polyfill doesnt support all these options
+inspect.defaultOptions = {
+ showHidden: false,
+ depth: 2,
+ colors: false,
+ customInspect: true,
+ showProxy: false,
+ maxArrayLength: 100,
+ maxStringLength: 10000,
+ breakLength: 80,
+ compact: 3,
+ sorted: false,
+ getters: false,
+ numericSeparator: false,
+};
function stylizeWithColor(str, styleType) {
- var style = inspect.styles[styleType];
- if (style) {
- return "\x1B[" + inspect.colors[style][0] + "m" + str + "\x1B[" + inspect.colors[style][1] + "m";
- } else {
- return str;
+ const style = inspect.styles[styleType];
+ if (style !== undefined) {
+ const color = inspect.colors[style];
+ if (color !== undefined) return `\u001b[${color[0]}m${str}\u001b[${color[1]}m`;
}
+ return str;
}
function stylizeNoColor(str, styleType) {
return str;
@@ -186,24 +203,21 @@ function arrayToHash(array) {
return hash;
}
function formatValue(ctx, value, recurseTimes) {
- if (
- ctx.customInspect &&
- value &&
- isFunction(value.inspect) &&
- value.inspect !== inspect &&
- !(value.constructor && value.constructor.prototype === value)
- ) {
- var ret = value.inspect(recurseTimes, ctx);
- if (!isString(ret)) {
- ret = formatValue(ctx, ret, recurseTimes);
+ if (ctx.customInspect && value) {
+ const customInspect = value[kInspectCustom];
+ if (isFunction(customInspect)) {
+ var ret = customInspect.call(value, recurseTimes, ctx, inspect);
+ if (!isString(ret)) {
+ ret = formatValue(ctx, ret, recurseTimes);
+ }
+ return ret;
}
- return ret;
}
var primitive = formatPrimitive(ctx, value);
if (primitive) {
return primitive;
}
- var keys = Object.keys(value);
+ var keys = Object.keys(value).concat(Object.getOwnPropertySymbols(value));
var visibleKeys = arrayToHash(keys);
if (ctx.showHidden) {
keys = Object.getOwnPropertyNames(value);
@@ -314,7 +328,10 @@ function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
}
}
if (!hasOwnProperty(visibleKeys, key)) {
- name = "[" + key + "]";
+ name = "[" + (typeof key === "symbol" ? key.description : key) + "]";
+ }
+ if (typeof key === "symbol") {
+ name = "[" + ctx.stylize(`Symbol(${key.description})`, "string") + "]";
}
if (!str) {
if (ctx.seen.indexOf(desc.value) < 0) {
diff --git a/src/js/out/InternalModuleRegistryConstants.h b/src/js/out/InternalModuleRegistryConstants.h
index 6f6c0676c..4e03279fa 100644
--- a/src/js/out/InternalModuleRegistryConstants.h
+++ b/src/js/out/InternalModuleRegistryConstants.h
@@ -178,7 +178,7 @@ static constexpr ASCIILiteral NodeUrlCode = "(function (){\"use strict\";// src/
//
//
-static constexpr ASCIILiteral NodeUtilCode = "(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBufferInterface = function({ copy, fill, readUint8 }) {\n return typeof copy === \"function\" && typeof fill === \"function\" && typeof readUint8 === \"function\";\n}, isBuffer = function(value) {\n return Buffer.isBuffer(value) || typeof value === \"object\" && isBufferInterface(value || {});\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, formatWithOptions = function(inspectOptions, f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0;i < arguments.length; i++)\n objects.push(inspect(arguments[i], inspectOptions));\n return objects.join(\" \");\n }\n var i = 2, args = arguments, len = args.length, str = String(f).replace(formatRegExp, function(x2) {\n if (x2 === \"%%\")\n return \"%\";\n if (i >= len)\n return x2;\n switch (x2) {\n case \"%s\":\n return String(args[i++]);\n case \"%f\":\n return Number(args[i++]);\n case \"%d\":\n return Math.round(Number(args[i++]));\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n case \"%o\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n case \"%O\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n default:\n return x2;\n }\n });\n for (var x = args[i];i < len; x = args[++i])\n if (isNull(x) || !isObject(x))\n str += \" \" + x;\n else\n str += \" \" + inspect(x, inspectOptions);\n return str;\n}, format = function(...args) {\n return formatWithOptions({}, ...args);\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, inspect = function(obj, opts) {\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n if (arguments.length >= 3)\n ctx.depth = arguments[2];\n if (arguments.length >= 4)\n ctx.colors = arguments[3];\n if (isBoolean(opts))\n ctx.showHidden = opts;\n else if (opts)\n _extend(ctx, opts);\n if (isUndefined(ctx.showHidden))\n ctx.showHidden = !1;\n if (isUndefined(ctx.depth))\n ctx.depth = 2;\n if (isUndefined(ctx.colors))\n ctx.colors = !1;\n if (isUndefined(ctx.customInspect))\n ctx.customInspect = !0;\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}, stylizeWithColor = function(str, styleType) {\n var style = inspect.styles[styleType];\n if (style)\n return \"\\x1B[\" + inspect.colors[style][0] + \"m\" + str + \"\\x1B[\" + inspect.colors[style][1] + \"m\";\n else\n return str;\n}, stylizeNoColor = function(str, styleType) {\n return str;\n}, arrayToHash = function(array) {\n var hash = {};\n return array.forEach(function(val, idx) {\n hash[val] = !0;\n }), hash;\n}, formatValue = function(ctx, value, recurseTimes) {\n if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== inspect && !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret))\n ret = formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n var primitive = formatPrimitive(ctx, value);\n if (primitive)\n return primitive;\n var keys = Object.keys(value), visibleKeys = arrayToHash(keys);\n if (ctx.showHidden)\n keys = Object.getOwnPropertyNames(value);\n if (isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0))\n return formatError(value);\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name \? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if (isDate(value))\n return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if (isError(value))\n return formatError(value);\n }\n var base = \"\", array = !1, braces = [\"{\", \"}\"];\n if (@isArray(value))\n array = !0, braces = [\"[\", \"]\"];\n if (isFunction(value)) {\n var n = value.name \? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n if (isRegExp(value))\n base = \" \" + RegExp.prototype.toString.call(value);\n if (isDate(value))\n base = \" \" + Date.prototype.toUTCString.call(value);\n if (isError(value))\n base = \" \" + formatError(value);\n if (keys.length === 0 && (!array || value.length == 0))\n return braces[0] + base + braces[1];\n if (recurseTimes < 0)\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else\n return ctx.stylize(\"[Object]\", \"special\");\n ctx.seen.push(value);\n var output;\n if (array)\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n return ctx.seen.pop(), reduceToSingleString(output, base, braces);\n}, formatPrimitive = function(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize(\"undefined\", \"undefined\");\n if (isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if (isNumber(value))\n return ctx.stylize(\"\" + value, \"number\");\n if (isBoolean(value))\n return ctx.stylize(\"\" + value, \"boolean\");\n if (isNull(value))\n return ctx.stylize(\"null\", \"null\");\n}, formatError = function(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}, formatArray = function(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length;i < l; ++i)\n if (hasOwnProperty(value, String(i)))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), !0));\n else\n output.push(\"\");\n return keys.forEach(function(key) {\n if (!key.match(/^\\d+$/))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, !0));\n }), output;\n}, formatProperty = function(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n if (desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n }, desc.get)\n if (desc.set)\n str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else\n str = ctx.stylize(\"[Getter]\", \"special\");\n else if (desc.set)\n str = ctx.stylize(\"[Setter]\", \"special\");\n if (!hasOwnProperty(visibleKeys, key))\n name = \"[\" + key + \"]\";\n if (!str)\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes))\n str = formatValue(ctx, desc.value, null);\n else\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1)\n if (array)\n str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").substr(2);\n else\n str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n } else\n str = ctx.stylize(\"[Circular]\", \"special\");\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/))\n return str;\n if (name = JSON.stringify(\"\" + key), name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/))\n name = name.substr(1, name.length - 2), name = ctx.stylize(name, \"name\");\n else\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), name = ctx.stylize(name, \"string\");\n }\n return name + \": \" + str;\n}, reduceToSingleString = function(output, base, braces) {\n var numLinesEst = 0, length = output.reduce(function(prev, cur) {\n if (numLinesEst++, cur.indexOf(\"\\n\") >= 0)\n numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d\?m/g, \"\").length + 1;\n }, 0);\n if (length > 60)\n return braces[0] + (base === \"\" \? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, hasOwnProperty = function(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = Array.prototype.slice.call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.apply(self, arguments);\n };\n original.apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"node:util/types\"), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, formatRegExp = /%[sdjfoc%]/g, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv;\ninspect.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n};\ninspect.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n};\nvar { isRegExp, isDate, isNativeError: isError } = types, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeUtilCode = "(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBufferInterface = function({ copy, fill, readUint8 }) {\n return typeof copy === \"function\" && typeof fill === \"function\" && typeof readUint8 === \"function\";\n}, isBuffer = function(value) {\n return Buffer.isBuffer(value) || typeof value === \"object\" && isBufferInterface(value || {});\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, formatWithOptions = function(inspectOptions, f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0;i < arguments.length; i++)\n objects.push(inspect(arguments[i], inspectOptions));\n return objects.join(\" \");\n }\n var i = 2, args = arguments, len = args.length, str = String(f).replace(formatRegExp, function(x2) {\n if (x2 === \"%%\")\n return \"%\";\n if (i >= len)\n return x2;\n switch (x2) {\n case \"%s\":\n return String(args[i++]);\n case \"%f\":\n return Number(args[i++]);\n case \"%d\":\n return Math.round(Number(args[i++]));\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n case \"%o\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n case \"%O\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n default:\n return x2;\n }\n });\n for (var x = args[i];i < len; x = args[++i])\n if (isNull(x) || !isObject(x))\n str += \" \" + x;\n else\n str += \" \" + inspect(x, inspectOptions);\n return str;\n}, format = function(...args) {\n return formatWithOptions({}, ...args);\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, inspect = function(obj, opts) {\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n if (arguments.length >= 3)\n ctx.depth = arguments[2];\n if (arguments.length >= 4)\n ctx.colors = arguments[3];\n if (isBoolean(opts))\n ctx.showHidden = opts;\n else if (opts)\n _extend(ctx, opts);\n if (isUndefined(ctx.showHidden))\n ctx.showHidden = !1;\n if (isUndefined(ctx.depth))\n ctx.depth = 2;\n if (isUndefined(ctx.colors))\n ctx.colors = !1;\n if (isUndefined(ctx.customInspect))\n ctx.customInspect = !0;\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}, stylizeWithColor = function(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== void 0) {\n const color = inspect.colors[style];\n if (color !== void 0)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n}, stylizeNoColor = function(str, styleType) {\n return str;\n}, arrayToHash = function(array) {\n var hash = {};\n return array.forEach(function(val, idx) {\n hash[val] = !0;\n }), hash;\n}, formatValue = function(ctx, value, recurseTimes) {\n if (ctx.customInspect && value) {\n const customInspect = value[kInspectCustom];\n if (isFunction(customInspect)) {\n var ret = customInspect.call(value, recurseTimes, ctx, inspect);\n if (!isString(ret))\n ret = formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n }\n var primitive = formatPrimitive(ctx, value);\n if (primitive)\n return primitive;\n var keys = Object.keys(value).concat(Object.getOwnPropertySymbols(value)), visibleKeys = arrayToHash(keys);\n if (ctx.showHidden)\n keys = Object.getOwnPropertyNames(value);\n if (isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0))\n return formatError(value);\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name \? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if (isDate(value))\n return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if (isError(value))\n return formatError(value);\n }\n var base = \"\", array = !1, braces = [\"{\", \"}\"];\n if (@isArray(value))\n array = !0, braces = [\"[\", \"]\"];\n if (isFunction(value)) {\n var n = value.name \? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n if (isRegExp(value))\n base = \" \" + RegExp.prototype.toString.call(value);\n if (isDate(value))\n base = \" \" + Date.prototype.toUTCString.call(value);\n if (isError(value))\n base = \" \" + formatError(value);\n if (keys.length === 0 && (!array || value.length == 0))\n return braces[0] + base + braces[1];\n if (recurseTimes < 0)\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else\n return ctx.stylize(\"[Object]\", \"special\");\n ctx.seen.push(value);\n var output;\n if (array)\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n return ctx.seen.pop(), reduceToSingleString(output, base, braces);\n}, formatPrimitive = function(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize(\"undefined\", \"undefined\");\n if (isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if (isNumber(value))\n return ctx.stylize(\"\" + value, \"number\");\n if (isBoolean(value))\n return ctx.stylize(\"\" + value, \"boolean\");\n if (isNull(value))\n return ctx.stylize(\"null\", \"null\");\n}, formatError = function(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}, formatArray = function(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length;i < l; ++i)\n if (hasOwnProperty(value, String(i)))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), !0));\n else\n output.push(\"\");\n return keys.forEach(function(key) {\n if (!key.match(/^\\d+$/))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, !0));\n }), output;\n}, formatProperty = function(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n if (desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n }, desc.get)\n if (desc.set)\n str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else\n str = ctx.stylize(\"[Getter]\", \"special\");\n else if (desc.set)\n str = ctx.stylize(\"[Setter]\", \"special\");\n if (!hasOwnProperty(visibleKeys, key))\n name = \"[\" + (typeof key === \"symbol\" \? key.description : key) + \"]\";\n if (typeof key === \"symbol\")\n name = \"[\" + ctx.stylize(`Symbol(${key.description})`, \"string\") + \"]\";\n if (!str)\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes))\n str = formatValue(ctx, desc.value, null);\n else\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1)\n if (array)\n str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").substr(2);\n else\n str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n } else\n str = ctx.stylize(\"[Circular]\", \"special\");\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/))\n return str;\n if (name = JSON.stringify(\"\" + key), name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/))\n name = name.substr(1, name.length - 2), name = ctx.stylize(name, \"name\");\n else\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), name = ctx.stylize(name, \"string\");\n }\n return name + \": \" + str;\n}, reduceToSingleString = function(output, base, braces) {\n var numLinesEst = 0, length = output.reduce(function(prev, cur) {\n if (numLinesEst++, cur.indexOf(\"\\n\") >= 0)\n numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d\?m/g, \"\").length + 1;\n }, 0);\n if (length > 60)\n return braces[0] + (base === \"\" \? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, hasOwnProperty = function(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = Array.prototype.slice.call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.apply(self, arguments);\n };\n original.apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"node:util/types\"), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, formatRegExp = /%[sdjfoc%]/g, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv, kInspectCustom = Symbol.for(\"nodejs.util.inspect.custom\");\ninspect.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n};\ninspect.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n};\ninspect.custom = kInspectCustom;\ninspect.defaultOptions = {\n showHidden: !1,\n depth: 2,\n colors: !1,\n customInspect: !0,\n showProxy: !1,\n maxArrayLength: 100,\n maxStringLength: 1e4,\n breakLength: 80,\n compact: 3,\n sorted: !1,\n getters: !1,\n numericSeparator: !1\n};\nvar { isRegExp, isDate, isNativeError: isError } = types, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n"_s;
//
//
@@ -407,7 +407,7 @@ static constexpr ASCIILiteral NodeUrlCode = "(function (){\"use strict\";// src/
//
//
-static constexpr ASCIILiteral NodeUtilCode = "(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBufferInterface = function({ copy, fill, readUint8 }) {\n return typeof copy === \"function\" && typeof fill === \"function\" && typeof readUint8 === \"function\";\n}, isBuffer = function(value) {\n return Buffer.isBuffer(value) || typeof value === \"object\" && isBufferInterface(value || {});\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, formatWithOptions = function(inspectOptions, f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0;i < arguments.length; i++)\n objects.push(inspect(arguments[i], inspectOptions));\n return objects.join(\" \");\n }\n var i = 2, args = arguments, len = args.length, str = String(f).replace(formatRegExp, function(x2) {\n if (x2 === \"%%\")\n return \"%\";\n if (i >= len)\n return x2;\n switch (x2) {\n case \"%s\":\n return String(args[i++]);\n case \"%f\":\n return Number(args[i++]);\n case \"%d\":\n return Math.round(Number(args[i++]));\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n case \"%o\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n case \"%O\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n default:\n return x2;\n }\n });\n for (var x = args[i];i < len; x = args[++i])\n if (isNull(x) || !isObject(x))\n str += \" \" + x;\n else\n str += \" \" + inspect(x, inspectOptions);\n return str;\n}, format = function(...args) {\n return formatWithOptions({}, ...args);\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, inspect = function(obj, opts) {\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n if (arguments.length >= 3)\n ctx.depth = arguments[2];\n if (arguments.length >= 4)\n ctx.colors = arguments[3];\n if (isBoolean(opts))\n ctx.showHidden = opts;\n else if (opts)\n _extend(ctx, opts);\n if (isUndefined(ctx.showHidden))\n ctx.showHidden = !1;\n if (isUndefined(ctx.depth))\n ctx.depth = 2;\n if (isUndefined(ctx.colors))\n ctx.colors = !1;\n if (isUndefined(ctx.customInspect))\n ctx.customInspect = !0;\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}, stylizeWithColor = function(str, styleType) {\n var style = inspect.styles[styleType];\n if (style)\n return \"\\x1B[\" + inspect.colors[style][0] + \"m\" + str + \"\\x1B[\" + inspect.colors[style][1] + \"m\";\n else\n return str;\n}, stylizeNoColor = function(str, styleType) {\n return str;\n}, arrayToHash = function(array) {\n var hash = {};\n return array.forEach(function(val, idx) {\n hash[val] = !0;\n }), hash;\n}, formatValue = function(ctx, value, recurseTimes) {\n if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== inspect && !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret))\n ret = formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n var primitive = formatPrimitive(ctx, value);\n if (primitive)\n return primitive;\n var keys = Object.keys(value), visibleKeys = arrayToHash(keys);\n if (ctx.showHidden)\n keys = Object.getOwnPropertyNames(value);\n if (isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0))\n return formatError(value);\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name \? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if (isDate(value))\n return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if (isError(value))\n return formatError(value);\n }\n var base = \"\", array = !1, braces = [\"{\", \"}\"];\n if (@isArray(value))\n array = !0, braces = [\"[\", \"]\"];\n if (isFunction(value)) {\n var n = value.name \? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n if (isRegExp(value))\n base = \" \" + RegExp.prototype.toString.call(value);\n if (isDate(value))\n base = \" \" + Date.prototype.toUTCString.call(value);\n if (isError(value))\n base = \" \" + formatError(value);\n if (keys.length === 0 && (!array || value.length == 0))\n return braces[0] + base + braces[1];\n if (recurseTimes < 0)\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else\n return ctx.stylize(\"[Object]\", \"special\");\n ctx.seen.push(value);\n var output;\n if (array)\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n return ctx.seen.pop(), reduceToSingleString(output, base, braces);\n}, formatPrimitive = function(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize(\"undefined\", \"undefined\");\n if (isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if (isNumber(value))\n return ctx.stylize(\"\" + value, \"number\");\n if (isBoolean(value))\n return ctx.stylize(\"\" + value, \"boolean\");\n if (isNull(value))\n return ctx.stylize(\"null\", \"null\");\n}, formatError = function(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}, formatArray = function(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length;i < l; ++i)\n if (hasOwnProperty(value, String(i)))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), !0));\n else\n output.push(\"\");\n return keys.forEach(function(key) {\n if (!key.match(/^\\d+$/))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, !0));\n }), output;\n}, formatProperty = function(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n if (desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n }, desc.get)\n if (desc.set)\n str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else\n str = ctx.stylize(\"[Getter]\", \"special\");\n else if (desc.set)\n str = ctx.stylize(\"[Setter]\", \"special\");\n if (!hasOwnProperty(visibleKeys, key))\n name = \"[\" + key + \"]\";\n if (!str)\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes))\n str = formatValue(ctx, desc.value, null);\n else\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1)\n if (array)\n str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").substr(2);\n else\n str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n } else\n str = ctx.stylize(\"[Circular]\", \"special\");\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/))\n return str;\n if (name = JSON.stringify(\"\" + key), name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/))\n name = name.substr(1, name.length - 2), name = ctx.stylize(name, \"name\");\n else\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), name = ctx.stylize(name, \"string\");\n }\n return name + \": \" + str;\n}, reduceToSingleString = function(output, base, braces) {\n var numLinesEst = 0, length = output.reduce(function(prev, cur) {\n if (numLinesEst++, cur.indexOf(\"\\n\") >= 0)\n numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d\?m/g, \"\").length + 1;\n }, 0);\n if (length > 60)\n return braces[0] + (base === \"\" \? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, hasOwnProperty = function(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = Array.prototype.slice.call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.apply(self, arguments);\n };\n original.apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"node:util/types\"), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, formatRegExp = /%[sdjfoc%]/g, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv;\ninspect.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n};\ninspect.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n};\nvar { isRegExp, isDate, isNativeError: isError } = types, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeUtilCode = "(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBufferInterface = function({ copy, fill, readUint8 }) {\n return typeof copy === \"function\" && typeof fill === \"function\" && typeof readUint8 === \"function\";\n}, isBuffer = function(value) {\n return Buffer.isBuffer(value) || typeof value === \"object\" && isBufferInterface(value || {});\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, formatWithOptions = function(inspectOptions, f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0;i < arguments.length; i++)\n objects.push(inspect(arguments[i], inspectOptions));\n return objects.join(\" \");\n }\n var i = 2, args = arguments, len = args.length, str = String(f).replace(formatRegExp, function(x2) {\n if (x2 === \"%%\")\n return \"%\";\n if (i >= len)\n return x2;\n switch (x2) {\n case \"%s\":\n return String(args[i++]);\n case \"%f\":\n return Number(args[i++]);\n case \"%d\":\n return Math.round(Number(args[i++]));\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n case \"%o\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n case \"%O\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n default:\n return x2;\n }\n });\n for (var x = args[i];i < len; x = args[++i])\n if (isNull(x) || !isObject(x))\n str += \" \" + x;\n else\n str += \" \" + inspect(x, inspectOptions);\n return str;\n}, format = function(...args) {\n return formatWithOptions({}, ...args);\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, inspect = function(obj, opts) {\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n if (arguments.length >= 3)\n ctx.depth = arguments[2];\n if (arguments.length >= 4)\n ctx.colors = arguments[3];\n if (isBoolean(opts))\n ctx.showHidden = opts;\n else if (opts)\n _extend(ctx, opts);\n if (isUndefined(ctx.showHidden))\n ctx.showHidden = !1;\n if (isUndefined(ctx.depth))\n ctx.depth = 2;\n if (isUndefined(ctx.colors))\n ctx.colors = !1;\n if (isUndefined(ctx.customInspect))\n ctx.customInspect = !0;\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}, stylizeWithColor = function(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== void 0) {\n const color = inspect.colors[style];\n if (color !== void 0)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n}, stylizeNoColor = function(str, styleType) {\n return str;\n}, arrayToHash = function(array) {\n var hash = {};\n return array.forEach(function(val, idx) {\n hash[val] = !0;\n }), hash;\n}, formatValue = function(ctx, value, recurseTimes) {\n if (ctx.customInspect && value) {\n const customInspect = value[kInspectCustom];\n if (isFunction(customInspect)) {\n var ret = customInspect.call(value, recurseTimes, ctx, inspect);\n if (!isString(ret))\n ret = formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n }\n var primitive = formatPrimitive(ctx, value);\n if (primitive)\n return primitive;\n var keys = Object.keys(value).concat(Object.getOwnPropertySymbols(value)), visibleKeys = arrayToHash(keys);\n if (ctx.showHidden)\n keys = Object.getOwnPropertyNames(value);\n if (isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0))\n return formatError(value);\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name \? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if (isDate(value))\n return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if (isError(value))\n return formatError(value);\n }\n var base = \"\", array = !1, braces = [\"{\", \"}\"];\n if (@isArray(value))\n array = !0, braces = [\"[\", \"]\"];\n if (isFunction(value)) {\n var n = value.name \? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n if (isRegExp(value))\n base = \" \" + RegExp.prototype.toString.call(value);\n if (isDate(value))\n base = \" \" + Date.prototype.toUTCString.call(value);\n if (isError(value))\n base = \" \" + formatError(value);\n if (keys.length === 0 && (!array || value.length == 0))\n return braces[0] + base + braces[1];\n if (recurseTimes < 0)\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else\n return ctx.stylize(\"[Object]\", \"special\");\n ctx.seen.push(value);\n var output;\n if (array)\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n return ctx.seen.pop(), reduceToSingleString(output, base, braces);\n}, formatPrimitive = function(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize(\"undefined\", \"undefined\");\n if (isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if (isNumber(value))\n return ctx.stylize(\"\" + value, \"number\");\n if (isBoolean(value))\n return ctx.stylize(\"\" + value, \"boolean\");\n if (isNull(value))\n return ctx.stylize(\"null\", \"null\");\n}, formatError = function(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}, formatArray = function(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length;i < l; ++i)\n if (hasOwnProperty(value, String(i)))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), !0));\n else\n output.push(\"\");\n return keys.forEach(function(key) {\n if (!key.match(/^\\d+$/))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, !0));\n }), output;\n}, formatProperty = function(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n if (desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n }, desc.get)\n if (desc.set)\n str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else\n str = ctx.stylize(\"[Getter]\", \"special\");\n else if (desc.set)\n str = ctx.stylize(\"[Setter]\", \"special\");\n if (!hasOwnProperty(visibleKeys, key))\n name = \"[\" + (typeof key === \"symbol\" \? key.description : key) + \"]\";\n if (typeof key === \"symbol\")\n name = \"[\" + ctx.stylize(`Symbol(${key.description})`, \"string\") + \"]\";\n if (!str)\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes))\n str = formatValue(ctx, desc.value, null);\n else\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1)\n if (array)\n str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").substr(2);\n else\n str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n } else\n str = ctx.stylize(\"[Circular]\", \"special\");\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/))\n return str;\n if (name = JSON.stringify(\"\" + key), name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/))\n name = name.substr(1, name.length - 2), name = ctx.stylize(name, \"name\");\n else\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), name = ctx.stylize(name, \"string\");\n }\n return name + \": \" + str;\n}, reduceToSingleString = function(output, base, braces) {\n var numLinesEst = 0, length = output.reduce(function(prev, cur) {\n if (numLinesEst++, cur.indexOf(\"\\n\") >= 0)\n numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d\?m/g, \"\").length + 1;\n }, 0);\n if (length > 60)\n return braces[0] + (base === \"\" \? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, hasOwnProperty = function(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = Array.prototype.slice.call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.apply(self, arguments);\n };\n original.apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"node:util/types\"), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, formatRegExp = /%[sdjfoc%]/g, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv, kInspectCustom = Symbol.for(\"nodejs.util.inspect.custom\");\ninspect.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n};\ninspect.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n};\ninspect.custom = kInspectCustom;\ninspect.defaultOptions = {\n showHidden: !1,\n depth: 2,\n colors: !1,\n customInspect: !0,\n showProxy: !1,\n maxArrayLength: 100,\n maxStringLength: 1e4,\n breakLength: 80,\n compact: 3,\n sorted: !1,\n getters: !1,\n numericSeparator: !1\n};\nvar { isRegExp, isDate, isNativeError: isError } = types, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n"_s;
//
//
@@ -637,7 +637,7 @@ static constexpr ASCIILiteral NodeUrlCode = "(function (){\"use strict\";// src/
//
//
-static constexpr ASCIILiteral NodeUtilCode = "(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBufferInterface = function({ copy, fill, readUint8 }) {\n return typeof copy === \"function\" && typeof fill === \"function\" && typeof readUint8 === \"function\";\n}, isBuffer = function(value) {\n return Buffer.isBuffer(value) || typeof value === \"object\" && isBufferInterface(value || {});\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, formatWithOptions = function(inspectOptions, f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0;i < arguments.length; i++)\n objects.push(inspect(arguments[i], inspectOptions));\n return objects.join(\" \");\n }\n var i = 2, args = arguments, len = args.length, str = String(f).replace(formatRegExp, function(x2) {\n if (x2 === \"%%\")\n return \"%\";\n if (i >= len)\n return x2;\n switch (x2) {\n case \"%s\":\n return String(args[i++]);\n case \"%f\":\n return Number(args[i++]);\n case \"%d\":\n return Math.round(Number(args[i++]));\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n case \"%o\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n case \"%O\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n default:\n return x2;\n }\n });\n for (var x = args[i];i < len; x = args[++i])\n if (isNull(x) || !isObject(x))\n str += \" \" + x;\n else\n str += \" \" + inspect(x, inspectOptions);\n return str;\n}, format = function(...args) {\n return formatWithOptions({}, ...args);\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, inspect = function(obj, opts) {\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n if (arguments.length >= 3)\n ctx.depth = arguments[2];\n if (arguments.length >= 4)\n ctx.colors = arguments[3];\n if (isBoolean(opts))\n ctx.showHidden = opts;\n else if (opts)\n _extend(ctx, opts);\n if (isUndefined(ctx.showHidden))\n ctx.showHidden = !1;\n if (isUndefined(ctx.depth))\n ctx.depth = 2;\n if (isUndefined(ctx.colors))\n ctx.colors = !1;\n if (isUndefined(ctx.customInspect))\n ctx.customInspect = !0;\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}, stylizeWithColor = function(str, styleType) {\n var style = inspect.styles[styleType];\n if (style)\n return \"\\x1B[\" + inspect.colors[style][0] + \"m\" + str + \"\\x1B[\" + inspect.colors[style][1] + \"m\";\n else\n return str;\n}, stylizeNoColor = function(str, styleType) {\n return str;\n}, arrayToHash = function(array) {\n var hash = {};\n return array.forEach(function(val, idx) {\n hash[val] = !0;\n }), hash;\n}, formatValue = function(ctx, value, recurseTimes) {\n if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== inspect && !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret))\n ret = formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n var primitive = formatPrimitive(ctx, value);\n if (primitive)\n return primitive;\n var keys = Object.keys(value), visibleKeys = arrayToHash(keys);\n if (ctx.showHidden)\n keys = Object.getOwnPropertyNames(value);\n if (isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0))\n return formatError(value);\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name \? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if (isDate(value))\n return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if (isError(value))\n return formatError(value);\n }\n var base = \"\", array = !1, braces = [\"{\", \"}\"];\n if (@isArray(value))\n array = !0, braces = [\"[\", \"]\"];\n if (isFunction(value)) {\n var n = value.name \? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n if (isRegExp(value))\n base = \" \" + RegExp.prototype.toString.call(value);\n if (isDate(value))\n base = \" \" + Date.prototype.toUTCString.call(value);\n if (isError(value))\n base = \" \" + formatError(value);\n if (keys.length === 0 && (!array || value.length == 0))\n return braces[0] + base + braces[1];\n if (recurseTimes < 0)\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else\n return ctx.stylize(\"[Object]\", \"special\");\n ctx.seen.push(value);\n var output;\n if (array)\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n return ctx.seen.pop(), reduceToSingleString(output, base, braces);\n}, formatPrimitive = function(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize(\"undefined\", \"undefined\");\n if (isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if (isNumber(value))\n return ctx.stylize(\"\" + value, \"number\");\n if (isBoolean(value))\n return ctx.stylize(\"\" + value, \"boolean\");\n if (isNull(value))\n return ctx.stylize(\"null\", \"null\");\n}, formatError = function(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}, formatArray = function(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length;i < l; ++i)\n if (hasOwnProperty(value, String(i)))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), !0));\n else\n output.push(\"\");\n return keys.forEach(function(key) {\n if (!key.match(/^\\d+$/))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, !0));\n }), output;\n}, formatProperty = function(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n if (desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n }, desc.get)\n if (desc.set)\n str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else\n str = ctx.stylize(\"[Getter]\", \"special\");\n else if (desc.set)\n str = ctx.stylize(\"[Setter]\", \"special\");\n if (!hasOwnProperty(visibleKeys, key))\n name = \"[\" + key + \"]\";\n if (!str)\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes))\n str = formatValue(ctx, desc.value, null);\n else\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1)\n if (array)\n str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").substr(2);\n else\n str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n } else\n str = ctx.stylize(\"[Circular]\", \"special\");\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/))\n return str;\n if (name = JSON.stringify(\"\" + key), name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/))\n name = name.substr(1, name.length - 2), name = ctx.stylize(name, \"name\");\n else\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), name = ctx.stylize(name, \"string\");\n }\n return name + \": \" + str;\n}, reduceToSingleString = function(output, base, braces) {\n var numLinesEst = 0, length = output.reduce(function(prev, cur) {\n if (numLinesEst++, cur.indexOf(\"\\n\") >= 0)\n numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d\?m/g, \"\").length + 1;\n }, 0);\n if (length > 60)\n return braces[0] + (base === \"\" \? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, hasOwnProperty = function(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = Array.prototype.slice.call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.apply(self, arguments);\n };\n original.apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"node:util/types\"), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, formatRegExp = /%[sdjfoc%]/g, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv;\ninspect.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n};\ninspect.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n};\nvar { isRegExp, isDate, isNativeError: isError } = types, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n"_s;
+static constexpr ASCIILiteral NodeUtilCode = "(function (){\"use strict\";// src/js/out/tmp/node/util.ts\nvar isBufferInterface = function({ copy, fill, readUint8 }) {\n return typeof copy === \"function\" && typeof fill === \"function\" && typeof readUint8 === \"function\";\n}, isBuffer = function(value) {\n return Buffer.isBuffer(value) || typeof value === \"object\" && isBufferInterface(value || {});\n}, isFunction = function(value) {\n return typeof value === \"function\";\n}, formatWithOptions = function(inspectOptions, f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0;i < arguments.length; i++)\n objects.push(inspect(arguments[i], inspectOptions));\n return objects.join(\" \");\n }\n var i = 2, args = arguments, len = args.length, str = String(f).replace(formatRegExp, function(x2) {\n if (x2 === \"%%\")\n return \"%\";\n if (i >= len)\n return x2;\n switch (x2) {\n case \"%s\":\n return String(args[i++]);\n case \"%f\":\n return Number(args[i++]);\n case \"%d\":\n return Math.round(Number(args[i++]));\n case \"%j\":\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return \"[Circular]\";\n }\n case \"%o\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n case \"%O\":\n return inspect(args[i++], { showHidden: !0, showProxy: !0, ...inspectOptions });\n default:\n return x2;\n }\n });\n for (var x = args[i];i < len; x = args[++i])\n if (isNull(x) || !isObject(x))\n str += \" \" + x;\n else\n str += \" \" + inspect(x, inspectOptions);\n return str;\n}, format = function(...args) {\n return formatWithOptions({}, ...args);\n}, deprecate = function(fn, msg, code) {\n if (process.noDeprecation === !0)\n return fn;\n var warned = !1;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n var err = new Error(msg);\n if (code)\n err.code = code;\n throw err;\n } else if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n warned = !0;\n }\n return fn.apply(this, arguments);\n }\n return deprecated;\n}, debuglog = function(set) {\n if (set = set.toUpperCase(), !debugs[set])\n if (debugEnvRegex.test(set)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = format.apply(cjs_exports, arguments);\n console.error(\"%s %d: %s\", set, pid, msg);\n };\n } else\n debugs[set] = function() {\n };\n return debugs[set];\n}, inspect = function(obj, opts) {\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n if (arguments.length >= 3)\n ctx.depth = arguments[2];\n if (arguments.length >= 4)\n ctx.colors = arguments[3];\n if (isBoolean(opts))\n ctx.showHidden = opts;\n else if (opts)\n _extend(ctx, opts);\n if (isUndefined(ctx.showHidden))\n ctx.showHidden = !1;\n if (isUndefined(ctx.depth))\n ctx.depth = 2;\n if (isUndefined(ctx.colors))\n ctx.colors = !1;\n if (isUndefined(ctx.customInspect))\n ctx.customInspect = !0;\n if (ctx.colors)\n ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}, stylizeWithColor = function(str, styleType) {\n const style = inspect.styles[styleType];\n if (style !== void 0) {\n const color = inspect.colors[style];\n if (color !== void 0)\n return `\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`;\n }\n return str;\n}, stylizeNoColor = function(str, styleType) {\n return str;\n}, arrayToHash = function(array) {\n var hash = {};\n return array.forEach(function(val, idx) {\n hash[val] = !0;\n }), hash;\n}, formatValue = function(ctx, value, recurseTimes) {\n if (ctx.customInspect && value) {\n const customInspect = value[kInspectCustom];\n if (isFunction(customInspect)) {\n var ret = customInspect.call(value, recurseTimes, ctx, inspect);\n if (!isString(ret))\n ret = formatValue(ctx, ret, recurseTimes);\n return ret;\n }\n }\n var primitive = formatPrimitive(ctx, value);\n if (primitive)\n return primitive;\n var keys = Object.keys(value).concat(Object.getOwnPropertySymbols(value)), visibleKeys = arrayToHash(keys);\n if (ctx.showHidden)\n keys = Object.getOwnPropertyNames(value);\n if (isError(value) && (keys.indexOf(\"message\") >= 0 || keys.indexOf(\"description\") >= 0))\n return formatError(value);\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name \? \": \" + value.name : \"\";\n return ctx.stylize(\"[Function\" + name + \"]\", \"special\");\n }\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n if (isDate(value))\n return ctx.stylize(Date.prototype.toString.call(value), \"date\");\n if (isError(value))\n return formatError(value);\n }\n var base = \"\", array = !1, braces = [\"{\", \"}\"];\n if (@isArray(value))\n array = !0, braces = [\"[\", \"]\"];\n if (isFunction(value)) {\n var n = value.name \? \": \" + value.name : \"\";\n base = \" [Function\" + n + \"]\";\n }\n if (isRegExp(value))\n base = \" \" + RegExp.prototype.toString.call(value);\n if (isDate(value))\n base = \" \" + Date.prototype.toUTCString.call(value);\n if (isError(value))\n base = \" \" + formatError(value);\n if (keys.length === 0 && (!array || value.length == 0))\n return braces[0] + base + braces[1];\n if (recurseTimes < 0)\n if (isRegExp(value))\n return ctx.stylize(RegExp.prototype.toString.call(value), \"regexp\");\n else\n return ctx.stylize(\"[Object]\", \"special\");\n ctx.seen.push(value);\n var output;\n if (array)\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n else\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n return ctx.seen.pop(), reduceToSingleString(output, base, braces);\n}, formatPrimitive = function(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize(\"undefined\", \"undefined\");\n if (isString(value)) {\n var simple = \"'\" + JSON.stringify(value).replace(/^\"|\"$/g, \"\").replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"') + \"'\";\n return ctx.stylize(simple, \"string\");\n }\n if (isNumber(value))\n return ctx.stylize(\"\" + value, \"number\");\n if (isBoolean(value))\n return ctx.stylize(\"\" + value, \"boolean\");\n if (isNull(value))\n return ctx.stylize(\"null\", \"null\");\n}, formatError = function(value) {\n return \"[\" + Error.prototype.toString.call(value) + \"]\";\n}, formatArray = function(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length;i < l; ++i)\n if (hasOwnProperty(value, String(i)))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), !0));\n else\n output.push(\"\");\n return keys.forEach(function(key) {\n if (!key.match(/^\\d+$/))\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, !0));\n }), output;\n}, formatProperty = function(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n if (desc = Object.getOwnPropertyDescriptor(value, key) || {\n value: value[key]\n }, desc.get)\n if (desc.set)\n str = ctx.stylize(\"[Getter/Setter]\", \"special\");\n else\n str = ctx.stylize(\"[Getter]\", \"special\");\n else if (desc.set)\n str = ctx.stylize(\"[Setter]\", \"special\");\n if (!hasOwnProperty(visibleKeys, key))\n name = \"[\" + (typeof key === \"symbol\" \? key.description : key) + \"]\";\n if (typeof key === \"symbol\")\n name = \"[\" + ctx.stylize(`Symbol(${key.description})`, \"string\") + \"]\";\n if (!str)\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes))\n str = formatValue(ctx, desc.value, null);\n else\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n if (str.indexOf(\"\\n\") > -1)\n if (array)\n str = str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\").substr(2);\n else\n str = \"\\n\" + str.split(\"\\n\").map(function(line) {\n return \" \" + line;\n }).join(\"\\n\");\n } else\n str = ctx.stylize(\"[Circular]\", \"special\");\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/))\n return str;\n if (name = JSON.stringify(\"\" + key), name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/))\n name = name.substr(1, name.length - 2), name = ctx.stylize(name, \"name\");\n else\n name = name.replace(/'/g, \"\\\\'\").replace(/\\\\\"/g, '\"').replace(/(^\"|\"$)/g, \"'\"), name = ctx.stylize(name, \"string\");\n }\n return name + \": \" + str;\n}, reduceToSingleString = function(output, base, braces) {\n var numLinesEst = 0, length = output.reduce(function(prev, cur) {\n if (numLinesEst++, cur.indexOf(\"\\n\") >= 0)\n numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d\?m/g, \"\").length + 1;\n }, 0);\n if (length > 60)\n return braces[0] + (base === \"\" \? \"\" : base + \"\\n \") + \" \" + output.join(\",\\n \") + \" \" + braces[1];\n return braces[0] + base + \" \" + output.join(\", \") + \" \" + braces[1];\n}, isBoolean = function(arg) {\n return typeof arg === \"boolean\";\n}, isNull = function(arg) {\n return arg === null;\n}, isNullOrUndefined = function(arg) {\n return arg == null;\n}, isNumber = function(arg) {\n return typeof arg === \"number\";\n}, isString = function(arg) {\n return typeof arg === \"string\";\n}, isSymbol = function(arg) {\n return typeof arg === \"symbol\";\n}, isUndefined = function(arg) {\n return arg === void 0;\n}, isObject = function(arg) {\n return typeof arg === \"object\" && arg !== null;\n}, isPrimitive = function(arg) {\n return arg === null || typeof arg === \"boolean\" || typeof arg === \"number\" || typeof arg === \"string\" || typeof arg === \"symbol\" || typeof arg === \"undefined\";\n}, pad = function(n) {\n return n < 10 \? \"0\" + n.toString(10) : n.toString(10);\n}, timestamp = function() {\n var d = new Date, time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(\":\");\n return [d.getDate(), months[d.getMonth()], time].join(\" \");\n}, hasOwnProperty = function(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}, callbackifyOnRejected = function(reason, cb) {\n if (!reason) {\n var newReason = new Error(\"Promise was rejected with a falsy value\");\n newReason.reason = reason, newReason.code = \"ERR_FALSY_VALUE_REJECTION\", reason = newReason;\n }\n return cb(reason);\n}, callbackify = function(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n function callbackified() {\n var args = Array.prototype.slice.call(arguments), maybeCb = args.pop();\n if (typeof maybeCb !== \"function\")\n @throwTypeError(\"The last argument must be of type Function\");\n var self = this, cb = function() {\n return maybeCb.apply(self, arguments);\n };\n original.apply(this, args).then(function(ret) {\n process.nextTick(cb, null, ret);\n }, function(rej) {\n process.nextTick(callbackifyOnRejected, rej, cb);\n });\n }\n return Object.setPrototypeOf(callbackified, Object.getPrototypeOf(original)), Object.defineProperties(callbackified, getOwnPropertyDescriptors(original)), callbackified;\n}, $, types = @requireNativeModule(\"node:util/types\"), cjs_exports = {}, deepEquals = Bun.deepEquals, isDeepStrictEqual = (a, b) => deepEquals(a, b, !0), getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors, formatRegExp = /%[sdjfoc%]/g, debugs = {}, debugEnvRegex = /^$/;\nif (process.env.NODE_DEBUG)\n debugEnv = process.env.NODE_DEBUG, debugEnv = debugEnv.replace(/[|\\\\{}()[\\]^$+\?.]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/,/g, \"$|^\").toUpperCase(), debugEnvRegex = new RegExp(\"^\" + debugEnv + \"$\", \"i\");\nvar debugEnv, kInspectCustom = Symbol.for(\"nodejs.util.inspect.custom\");\ninspect.colors = {\n bold: [1, 22],\n italic: [3, 23],\n underline: [4, 24],\n inverse: [7, 27],\n white: [37, 39],\n grey: [90, 39],\n black: [30, 39],\n blue: [34, 39],\n cyan: [36, 39],\n green: [32, 39],\n magenta: [35, 39],\n red: [31, 39],\n yellow: [33, 39]\n};\ninspect.styles = {\n special: \"cyan\",\n number: \"yellow\",\n boolean: \"yellow\",\n undefined: \"grey\",\n null: \"bold\",\n string: \"green\",\n date: \"magenta\",\n regexp: \"red\"\n};\ninspect.custom = kInspectCustom;\ninspect.defaultOptions = {\n showHidden: !1,\n depth: 2,\n colors: !1,\n customInspect: !0,\n showProxy: !1,\n maxArrayLength: 100,\n maxStringLength: 1e4,\n breakLength: 80,\n compact: 3,\n sorted: !1,\n getters: !1,\n numericSeparator: !1\n};\nvar { isRegExp, isDate, isNativeError: isError } = types, months = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], log = function log2() {\n console.log(\"%s - %s\", timestamp(), format.apply(cjs_exports, arguments));\n}, inherits = function inherits2(ctor, superCtor) {\n ctor.super_ = superCtor, ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n });\n}, _extend = function(origin, add) {\n if (!add || !isObject(add))\n return origin;\n var keys = Object.keys(add), i = keys.length;\n while (i--)\n origin[keys[i]] = add[keys[i]];\n return origin;\n}, kCustomPromisifiedSymbol = Symbol.for(\"util.promisify.custom\"), promisify = function promisify2(original) {\n if (typeof original !== \"function\")\n @throwTypeError('The \"original\" argument must be of type Function');\n if (kCustomPromisifiedSymbol && original[kCustomPromisifiedSymbol]) {\n var fn = original[kCustomPromisifiedSymbol];\n if (typeof fn !== \"function\")\n @throwTypeError('The \"util.promisify.custom\" argument must be of type Function');\n return Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n }), fn;\n }\n function fn() {\n var promiseResolve, promiseReject, promise = new Promise(function(resolve, reject) {\n promiseResolve = resolve, promiseReject = reject;\n }), args = [];\n for (var i = 0;i < arguments.length; i++)\n args.push(arguments[i]);\n args.push(function(err, value) {\n if (err)\n promiseReject(err);\n else\n promiseResolve(value);\n });\n try {\n original.apply(this, args);\n } catch (err) {\n promiseReject(err);\n }\n return promise;\n }\n if (Object.setPrototypeOf(fn, Object.getPrototypeOf(original)), kCustomPromisifiedSymbol)\n Object.defineProperty(fn, kCustomPromisifiedSymbol, {\n value: fn,\n enumerable: !1,\n writable: !1,\n configurable: !0\n });\n return Object.defineProperties(fn, getOwnPropertyDescriptors(original));\n};\npromisify.custom = kCustomPromisifiedSymbol;\nvar toUSVString = (input) => {\n return (input + \"\").toWellFormed();\n};\n$ = Object.assign(cjs_exports, {\n format,\n formatWithOptions,\n deprecate,\n debuglog,\n _extend,\n inspect,\n types,\n isArray: @isArray,\n isBoolean,\n isNull,\n isNullOrUndefined,\n isNumber,\n isString,\n isSymbol,\n isUndefined,\n isRegExp,\n isObject,\n isDate,\n isFunction,\n isError,\n isPrimitive,\n isBuffer,\n log,\n inherits,\n toUSVString,\n promisify,\n callbackify,\n isDeepStrictEqual,\n TextDecoder,\n TextEncoder\n});\nreturn $})\n"_s;
//
//
diff --git a/src/js/out/WebCoreJSBuiltins.cpp b/src/js/out/WebCoreJSBuiltins.cpp
index f789f3d25..38114bab6 100644
--- a/src/js/out/WebCoreJSBuiltins.cpp
+++ b/src/js/out/WebCoreJSBuiltins.cpp
@@ -1339,6 +1339,32 @@ JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
#undef DEFINE_BUILTIN_GENERATOR
+/* UtilInspect.ts */
+// getStylizeWithColor
+const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_utilInspectGetStylizeWithColorCodeLength = 261;
+static const JSC::Intrinsic s_utilInspectGetStylizeWithColorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_utilInspectGetStylizeWithColorCode = "(function (inspect){\"use strict\";return function stylizeWithColor(str,styleType){const style=inspect.styles[styleType];if(style!==@undefined){const color=inspect.colors[style];if(color!==@undefined)return`\\x1B[${color[0]}m${str}\\x1B[${color[1]}m`}return str}})\n";
+
+// stylizeWithNoColor
+const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
+const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind = JSC::ConstructorKind::None;
+const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility = JSC::ImplementationVisibility::Public;
+const int s_utilInspectStylizeWithNoColorCodeLength = 42;
+static const JSC::Intrinsic s_utilInspectStylizeWithNoColorCodeIntrinsic = JSC::NoIntrinsic;
+const char* const s_utilInspectStylizeWithNoColorCode = "(function (str){\"use strict\";return str})\n";
+
+#define DEFINE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+JSC::FunctionExecutable* codeName##Generator(JSC::VM& vm) \
+{\
+ JSVMClientData* clientData = static_cast<JSVMClientData*>(vm.clientData); \
+ return clientData->builtinFunctions().utilInspectBuiltins().codeName##Executable()->link(vm, nullptr, clientData->builtinFunctions().utilInspectBuiltins().codeName##Source(), std::nullopt, s_##codeName##Intrinsic); \
+}
+WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_GENERATOR)
+#undef DEFINE_BUILTIN_GENERATOR
+
/* ConsoleObject.ts */
// asyncIterator
const JSC::ConstructAbility s_consoleObjectAsyncIteratorCodeConstructAbility = JSC::ConstructAbility::CannotConstruct;
diff --git a/src/js/out/WebCoreJSBuiltins.h b/src/js/out/WebCoreJSBuiltins.h
index e540facb9..e2ecb32d8 100644
--- a/src/js/out/WebCoreJSBuiltins.h
+++ b/src/js/out/WebCoreJSBuiltins.h
@@ -2391,6 +2391,95 @@ inline void ReadableByteStreamControllerBuiltinsWrapper::exportNames()
WEBCORE_FOREACH_READABLEBYTESTREAMCONTROLLER_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
#undef EXPORT_FUNCTION_NAME
}
+/* UtilInspect.ts */
+// getStylizeWithColor
+#define WEBCORE_BUILTIN_UTILINSPECT_GETSTYLIZEWITHCOLOR 1
+extern const char* const s_utilInspectGetStylizeWithColorCode;
+extern const int s_utilInspectGetStylizeWithColorCodeLength;
+extern const JSC::ConstructAbility s_utilInspectGetStylizeWithColorCodeConstructAbility;
+extern const JSC::ConstructorKind s_utilInspectGetStylizeWithColorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_utilInspectGetStylizeWithColorCodeImplementationVisibility;
+
+// stylizeWithNoColor
+#define WEBCORE_BUILTIN_UTILINSPECT_STYLIZEWITHNOCOLOR 1
+extern const char* const s_utilInspectStylizeWithNoColorCode;
+extern const int s_utilInspectStylizeWithNoColorCodeLength;
+extern const JSC::ConstructAbility s_utilInspectStylizeWithNoColorCodeConstructAbility;
+extern const JSC::ConstructorKind s_utilInspectStylizeWithNoColorCodeConstructorKind;
+extern const JSC::ImplementationVisibility s_utilInspectStylizeWithNoColorCodeImplementationVisibility;
+
+#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_DATA(macro) \
+ macro(getStylizeWithColor, utilInspectGetStylizeWithColor, 1) \
+ macro(stylizeWithNoColor, utilInspectStylizeWithNoColor, 1) \
+
+#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(macro) \
+ macro(utilInspectGetStylizeWithColorCode, getStylizeWithColor, ASCIILiteral(), s_utilInspectGetStylizeWithColorCodeLength) \
+ macro(utilInspectStylizeWithNoColorCode, stylizeWithNoColor, ASCIILiteral(), s_utilInspectStylizeWithNoColorCodeLength) \
+
+#define WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(macro) \
+ macro(getStylizeWithColor) \
+ macro(stylizeWithNoColor) \
+
+#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \
+ JSC::FunctionExecutable* codeName##Generator(JSC::VM&);
+
+WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR)
+#undef DECLARE_BUILTIN_GENERATOR
+
+class UtilInspectBuiltinsWrapper : private JSC::WeakHandleOwner {
+public:
+ explicit UtilInspectBuiltinsWrapper(JSC::VM& vm)
+ : m_vm(vm)
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES)
+#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { }))
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS)
+#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS
+ {
+ }
+
+#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
+ JSC::UnlinkedFunctionExecutable* name##Executable(); \
+ const JSC::SourceCode& name##Source() const { return m_##name##Source; }
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES)
+#undef EXPOSE_BUILTIN_EXECUTABLES
+
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR)
+
+ void exportNames();
+
+private:
+ JSC::VM& m_vm;
+
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES)
+
+#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \
+ JSC::SourceCode m_##name##Source;\
+ JSC::Weak<JSC::UnlinkedFunctionExecutable> m_##name##Executable;
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS)
+#undef DECLARE_BUILTIN_SOURCE_MEMBERS
+
+};
+
+#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \
+inline JSC::UnlinkedFunctionExecutable* UtilInspectBuiltinsWrapper::name##Executable() \
+{\
+ if (!m_##name##Executable) {\
+ JSC::Identifier executableName = functionName##PublicName();\
+ if (overriddenName)\
+ executableName = JSC::Identifier::fromString(m_vm, overriddenName);\
+ m_##name##Executable = JSC::Weak<JSC::UnlinkedFunctionExecutable>(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\
+ }\
+ return m_##name##Executable.get();\
+}
+WEBCORE_FOREACH_UTILINSPECT_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES)
+#undef DEFINE_BUILTIN_EXECUTABLES
+
+inline void UtilInspectBuiltinsWrapper::exportNames()
+{
+#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName());
+ WEBCORE_FOREACH_UTILINSPECT_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME)
+#undef EXPORT_FUNCTION_NAME
+}
/* ConsoleObject.ts */
// asyncIterator
#define WEBCORE_BUILTIN_CONSOLEOBJECT_ASYNCITERATOR 1
@@ -5613,6 +5702,7 @@ public:
, m_moduleBuiltins(m_vm)
, m_jsBufferPrototypeBuiltins(m_vm)
, m_readableByteStreamControllerBuiltins(m_vm)
+ , m_utilInspectBuiltins(m_vm)
, m_consoleObjectBuiltins(m_vm)
, m_readableStreamInternalsBuiltins(m_vm)
, m_transformStreamDefaultControllerBuiltins(m_vm)
@@ -5646,6 +5736,7 @@ public:
ModuleBuiltinsWrapper& moduleBuiltins() { return m_moduleBuiltins; }
JSBufferPrototypeBuiltinsWrapper& jsBufferPrototypeBuiltins() { return m_jsBufferPrototypeBuiltins; }
ReadableByteStreamControllerBuiltinsWrapper& readableByteStreamControllerBuiltins() { return m_readableByteStreamControllerBuiltins; }
+ UtilInspectBuiltinsWrapper& utilInspectBuiltins() { return m_utilInspectBuiltins; }
ConsoleObjectBuiltinsWrapper& consoleObjectBuiltins() { return m_consoleObjectBuiltins; }
ReadableStreamInternalsBuiltinsWrapper& readableStreamInternalsBuiltins() { return m_readableStreamInternalsBuiltins; }
TransformStreamDefaultControllerBuiltinsWrapper& transformStreamDefaultControllerBuiltins() { return m_transformStreamDefaultControllerBuiltins; }
@@ -5674,6 +5765,7 @@ private:
ModuleBuiltinsWrapper m_moduleBuiltins;
JSBufferPrototypeBuiltinsWrapper m_jsBufferPrototypeBuiltins;
ReadableByteStreamControllerBuiltinsWrapper m_readableByteStreamControllerBuiltins;
+ UtilInspectBuiltinsWrapper m_utilInspectBuiltins;
ConsoleObjectBuiltinsWrapper m_consoleObjectBuiltins;
ReadableStreamInternalsBuiltinsWrapper m_readableStreamInternalsBuiltins;
TransformStreamDefaultControllerBuiltinsWrapper m_transformStreamDefaultControllerBuiltins;