Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23586,7 +23586,7 @@ var require_fast_content_type_parse = __commonJS({
});

// npm/node_modules/json-with-bigint/json-with-bigint.js
var intRegex, noiseValue, originalStringify, originalParse, customFormat, bigIntsStringify, noiseStringify, JSONStringify, isContextSourceSupported, convertMarkedBigIntsReviver, JSONParseV2, MAX_INT, MAX_DIGITS, stringsOrLargeNumbers, noiseValueWithQuotes, JSONParse;
var intRegex, noiseValue, originalStringify, originalParse, customFormat, bigIntsStringify, noiseStringify, JSONStringify, featureCache, isContextSourceSupported, convertMarkedBigIntsReviver, JSONParseV2, MAX_INT, MAX_DIGITS, stringsOrLargeNumbers, noiseValueWithQuotes, JSONParse;
var init_json_with_bigint = __esm({
"npm/node_modules/json-with-bigint/json-with-bigint.js"() {
intRegex = /^-?\d+$/;
Expand All @@ -23613,7 +23613,7 @@ var init_json_with_bigint = __esm({
const convertedToCustomJSON = originalStringify(
value,
(key, value2) => {
const isNoise = typeof value2 === "string" && Boolean(value2.match(noiseValue));
const isNoise = typeof value2 === "string" && noiseValue.test(value2);
if (isNoise) return value2.toString() + "n";
if (typeof value2 === "bigint") return value2.toString() + "n";
if (typeof replacer === "function") return replacer(key, value2);
Expand All @@ -23629,11 +23629,28 @@ var init_json_with_bigint = __esm({
const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3");
return denoisedJSON;
};
isContextSourceSupported = () => JSON.parse("1", (_, __, context) => !!context && context.source === "1");
featureCache = /* @__PURE__ */ new Map();
isContextSourceSupported = () => {
const parseFingerprint = JSON.parse.toString();
if (featureCache.has(parseFingerprint)) {
return featureCache.get(parseFingerprint);
}
try {
const result = JSON.parse(
"1",
(_, __, context) => !!context?.source && context.source === "1"
);
featureCache.set(parseFingerprint, result);
return result;
} catch {
featureCache.set(parseFingerprint, false);
return false;
}
};
convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
const isCustomFormatBigInt = typeof value === "string" && value.match(customFormat);
const isCustomFormatBigInt = typeof value === "string" && customFormat.test(value);
if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));
const isNoiseValue = typeof value === "string" && value.match(noiseValue);
const isNoiseValue = typeof value === "string" && noiseValue.test(value);
if (isNoiseValue) return value.slice(0, -1);
if (typeof userReviver !== "function") return value;
return userReviver(key, value, context);
Expand All @@ -23659,7 +23676,7 @@ var init_json_with_bigint = __esm({
stringsOrLargeNumbers,
(text2, digits, fractional, exponential) => {
const isString = text2[0] === '"';
const isNoise = isString && Boolean(text2.match(noiseValueWithQuotes));
const isNoise = isString && noiseValueWithQuotes.test(text2);
if (isNoise) return text2.substring(0, text2.length - 1) + 'n"';
const isFractionalOrExponential = fractional || exponential;
const isLessThanMaxSafeInt = digits && (digits.length < MAX_DIGITS || digits.length === MAX_DIGITS && digits <= MAX_INT);
Expand Down
Loading