summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/js/web/console.ts14
1 files changed, 5 insertions, 9 deletions
diff --git a/cli/js/web/console.ts b/cli/js/web/console.ts
index 622181030..0e17d2efb 100644
--- a/cli/js/web/console.ts
+++ b/cli/js/web/console.ts
@@ -124,23 +124,19 @@ function createIterableString<T>(
const iPrefix = `${config.displayName ? config.displayName + " " : ""}`;
+ const initIndentation = `\n${DEFAULT_INDENT.repeat(level + 1)}`;
+ const entryIndentation = `,\n${DEFAULT_INDENT.repeat(level + 1)}`;
+ const closingIndentation = `\n${DEFAULT_INDENT.repeat(level)}`;
+
let iContent: string;
if (config.group && entries.length > MIN_GROUP_LENGTH) {
const groups = groupEntries(entries, level, value);
- const initIndentation = `\n${DEFAULT_INDENT.repeat(level + 1)}`;
- const entryIndentation = `,\n${DEFAULT_INDENT.repeat(level + 1)}`;
- const closingIndentation = `\n${DEFAULT_INDENT.repeat(level)}`;
-
iContent = `${initIndentation}${groups.join(
entryIndentation
)}${closingIndentation}`;
} else {
iContent = entries.length === 0 ? "" : ` ${entries.join(", ")} `;
if (stripColor(iContent).length > LINE_BREAKING_LENGTH) {
- const initIndentation = `\n${DEFAULT_INDENT.repeat(level + 1)}`;
- const entryIndentation = `,\n${DEFAULT_INDENT.repeat(level + 1)}`;
- const closingIndentation = `\n`;
-
iContent = `${initIndentation}${entries.join(
entryIndentation
)}${closingIndentation}`;
@@ -343,7 +339,7 @@ function createArrayString(
const ending = emptyItems > 1 ? "s" : "";
return dim(`<${emptyItems} empty item${ending}>`);
} else {
- return stringifyWithQuotes(val, ctx, level + 1, maxLevel);
+ return stringifyWithQuotes(val, ctx, level, maxLevel);
}
},
group: true,