Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 449ee8d

Browse filesBrowse files
mscdextargos
authored andcommitted
console: fix table() output
Fixes: #27915 PR-URL: #27917 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent d982f0b commit 449ee8d
Copy full SHA for 449ee8d

File tree

Expand file treeCollapse file tree

2 files changed

+15
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+15
-0
lines changed
Open diff view settings
Collapse file

β€Žlib/internal/console/constructor.jsβ€Ž

Copy file name to clipboardExpand all lines: lib/internal/console/constructor.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ const consoleMethods = {
412412
const opt = {
413413
depth,
414414
maxArrayLength: 3,
415+
breakLength: Infinity,
415416
...this[kGetInspectOptions](this._stdout)
416417
};
417418
return inspect(v, opt);
Collapse file

β€Žtest/parallel/test-console-table.jsβ€Ž

Copy file name to clipboardExpand all lines: test/parallel/test-console-table.js
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,17 @@ test([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], `
244244
β”‚ 1 β”‚ 'Z' β”‚ 2 β”‚
245245
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”˜
246246
`);
247+
248+
{
249+
const line = '─'.repeat(79);
250+
const header = `${' '.repeat(37)}name${' '.repeat(40)}`;
251+
const name = 'very long long long long long long long long long long long ' +
252+
'long long long long';
253+
test([{ name }], `
254+
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€${line}──┐
255+
β”‚ (index) β”‚ ${header}β”‚
256+
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€${line}───
257+
β”‚ 0 β”‚ '${name}' β”‚
258+
└─────────┴──${line}β”€β”€β”˜
259+
`);
260+
}

0 commit comments

Comments
0Β (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.