fix(web-probe): bound script report summaries
This commit is contained in:
@@ -2095,20 +2095,20 @@ function compactStepForEvidence(step) {
|
||||
|
||||
function compactJsonForEvidence(value, depth = 0) {
|
||||
if (value === null || value === undefined) return value ?? null;
|
||||
if (typeof value === "string") return compactText(value, 600);
|
||||
if (typeof value === "string") return compactText(value, 240);
|
||||
if (typeof value === "number" || typeof value === "boolean") return value;
|
||||
if (typeof value === "bigint") return String(value);
|
||||
if (typeof value === "function" || typeof value === "symbol") return "[" + typeof value + "]";
|
||||
if (depth >= 8) return "[max-depth]";
|
||||
if (Array.isArray(value)) return value.slice(0, 16).map((item) => compactJsonForEvidence(item, depth + 1));
|
||||
if (depth >= 4) return "[max-depth]";
|
||||
if (Array.isArray(value)) return value.slice(0, 6).map((item) => compactJsonForEvidence(item, depth + 1));
|
||||
if (typeof value === "object") {
|
||||
const out = {};
|
||||
for (const [key, nested] of Object.entries(value).slice(0, 32)) {
|
||||
for (const [key, nested] of Object.entries(value).slice(0, 12)) {
|
||||
out[key] = compactJsonForEvidence(nested, depth + 1);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
return compactText(String(value), 600);
|
||||
return compactText(String(value), 240);
|
||||
}
|
||||
|
||||
function compactText(value, maxChars) {
|
||||
|
||||
Reference in New Issue
Block a user