Skip to content

Commit

Permalink
fix(ext/console): bump default max str lengthto 10_00 (#24245)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacasonato committed Jun 18, 2024
1 parent 10ac3bb commit 7b5c514
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ext/console/01_console.js
Original file line number Diff line number Diff line change
Expand Up @@ -2329,7 2329,7 @@ const denoInspectDefaultOptions = {

// node only
maxArrayLength: 100,
maxStringLength: 100, // deno: strAbbreviateSize: 100
maxStringLength: 10_000, // deno: strAbbreviateSize: 10_000
customInspect: true,

// deno only
Expand Down Expand Up @@ -2357,7 2357,7 @@ function getDefaultInspectOptions() {

const DEFAULT_INDENT = " "; // Default indent string

const STR_ABBREVIATE_SIZE = 100;
const STR_ABBREVIATE_SIZE = 10_000;

class CSI {
static kClear = "\x1b[1;1H";
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/console_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 174,11 @@ Deno.test(function consoleTestStringifyQuotes() {
});

Deno.test(function consoleTestStringifyLongStrings() {
const veryLongString = "a".repeat(200);
const veryLongString = "a".repeat(10_100);
// If we stringify an object containing the long string, it gets abbreviated.
let actual = stringify({ veryLongString });
assert(actual.includes("..."));
assert(actual.length < 200);
assert(actual.length < 10_100);
// However if we stringify the string itself, we get it exactly.
actual = stringify(veryLongString);
assertEquals(actual, veryLongString);
Expand Down

0 comments on commit 7b5c514

Please sign in to comment.