Commit 6877139
util: fix stylize of special properties in inspect
Previously, formatExtraProperties applied ctx.stylize to the entire
'[key]: value' string. This caused the colon and space to be styled,
making the output inconsistent with normal object properties.
Now, only the key itself is stylized, and the colon and space remain
unstyled, aligning with the formatting of regular properties.
Refs: #60131
PR-URL: #60479
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>1 parent edc3033 commit 6877139Copy full SHA for 6877139
File tree
Expand file treeCollapse file tree
2 files changed
+16
-1
lines changedOpen diff view settings
Filter options
- lib/internal/util
- test/parallel
Expand file treeCollapse file tree
2 files changed
+16
-1
lines changedOpen diff view settings
Collapse file
lib/internal/util/inspect.js
Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2520 | 2520 | |
2521 | 2521 | |
2522 | 2522 | |
2523 | | - |
| 2523 | + |
| 2524 | + |
2524 | 2525 | |
2525 | 2526 | |
2526 | 2527 | |
|
Collapse file
test/parallel/test-util-inspect.js
Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js+14Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2391 | 2391 | |
2392 | 2392 | |
2393 | 2393 | |
| 2394 | + |
| 2395 | + |
| 2396 | + |
| 2397 | + |
| 2398 | + |
| 2399 | + |
| 2400 | + |
| 2401 | + |
| 2402 | + |
| 2403 | + |
| 2404 | + |
| 2405 | + |
| 2406 | + |
| 2407 | + |
2394 | 2408 | |
2395 | 2409 | |
2396 | 2410 | |
|
0 commit comments