From 48eb55ee07d237ff2272e9763c1bbb5c72842f53 Mon Sep 17 00:00:00 2001 From: Rory& Date: Sat, 21 Mar 2026 14:46:30 +0100 Subject: Fix schemas script --- scripts/schema.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/schema.js b/scripts/schema.js index b4c156d7..f8733809 100644 --- a/scripts/schema.js +++ b/scripts/schema.js @@ -396,6 +396,7 @@ function columnizedObjectDiff(a, b, trackEqual = false) { return diffs; } +const showScanDepth = process.env.SCHEMAS_SHOW_SCAN_DEPTH === "true"; async function removeAllMatchingRecursive(o, selector, maxDepth = 32, path = "$") { // process.stdout.write("S"); // console.log("scan @", path, "with depth", maxDepth, typeof o, o); @@ -406,9 +407,9 @@ async function removeAllMatchingRecursive(o, selector, maxDepth = 32, path = "$" process.stdout.write(yellowBright("R(" + gray(k) + " @ " + cyan(path) + ") ")); delete o[k]; } else if (maxDepth > 0 && typeof o != "string") { - process.stdout.write(gray(">")); + if (showScanDepth) process.stdout.write(gray(">")); o[k] = await removeAllMatchingRecursive(o[k], selector, maxDepth - 1, path + "." + k); - process.stdout.write(cyan("\b \b")); + if (showScanDepth) process.stdout.write(cyan("\b \b")); } } -- cgit 1.5.1