Commit 4500ed8
util: add compact depth mode
This overloads the `compact` option from `util.inspect()`. If it's
set to a number, it is going to align all most inner entries on the
same lign if they adhere to the following:
* The entries do not exceed the `breakLength` options value.
* The entry is one of the local most inner levels up the the one
provided in `compact`.
PR-URL: #26269
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent 7bf6309 commit 4500ed8Copy full SHA for 4500ed8
File tree
Expand file treeCollapse file tree
3 files changed
+71
-14
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal/util
- test/parallel
Expand file treeCollapse file tree
3 files changed
+71
-14
lines changedOpen diff view settings
Collapse file
+10-5Lines changed: 10 additions & 5 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
375 | 375 | |
376 | 376 | |
377 | 377 | |
| 378 | + |
| 379 | + |
| 380 | + |
378 | 381 | |
379 | 382 | |
380 | 383 | |
| ||
444 | 447 | |
445 | 448 | |
446 | 449 | |
447 | | - |
448 | | - |
449 | | - |
450 | | - |
451 | | - |
| 450 | + |
| 451 | + |
| 452 | + |
| 453 | + |
| 454 | + |
| 455 | + |
| 456 | + |
452 | 457 | |
453 | 458 | |
454 | 459 | |
|
Collapse file
lib/internal/util/inspect.js
Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js+25-9Lines changed: 25 additions & 9 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
159 | 159 | |
160 | 160 | |
161 | 161 | |
| 162 | + |
162 | 163 | |
163 | 164 | |
164 | 165 | |
| ||
760 | 761 | |
761 | 762 | |
762 | 763 | |
| 764 | + |
763 | 765 | |
764 | 766 | |
765 | 767 | |
| ||
783 | 785 | |
784 | 786 | |
785 | 787 | |
786 | | - |
| 788 | + |
| 789 | + |
| 790 | + |
| 791 | + |
787 | 792 | |
788 | 793 | |
789 | 794 | |
| ||
824 | 829 | |
825 | 830 | |
826 | 831 | |
827 | | - |
| 832 | + |
828 | 833 | |
829 | 834 | |
830 | 835 | |
| ||
1134 | 1139 | |
1135 | 1140 | |
1136 | 1141 | |
1137 | | - |
| 1142 | + |
1138 | 1143 | |
1139 | 1144 | |
1140 | 1145 | |
| ||
1191 | 1196 | |
1192 | 1197 | |
1193 | 1198 | |
1194 | | - |
| 1199 | + |
1195 | 1200 | |
1196 | 1201 | |
1197 | | - |
1198 | | - |
1199 | | - |
| 1202 | + |
| 1203 | + |
| 1204 | + |
| 1205 | + |
| 1206 | + |
| 1207 | + |
| 1208 | + |
| 1209 | + |
| 1210 | + |
| 1211 | + |
| 1212 | + |
| 1213 | + |
| 1214 | + |
| 1215 | + |
1200 | 1216 | |
1201 | | - |
| 1217 | + |
1202 | 1218 | |
1203 | | - |
| 1219 | + |
1204 | 1220 | |
1205 | 1221 | |
1206 | 1222 | |
|
Collapse file
test/parallel/test-util-inspect.js
Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js+36Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1486 | 1486 | |
1487 | 1487 | |
1488 | 1488 | |
| 1489 | + |
| 1490 | + |
| 1491 | + |
| 1492 | + |
| 1493 | + |
| 1494 | + |
| 1495 | + |
| 1496 | + |
| 1497 | + |
| 1498 | + |
| 1499 | + |
| 1500 | + |
| 1501 | + |
| 1502 | + |
| 1503 | + |
| 1504 | + |
| 1505 | + |
| 1506 | + |
| 1507 | + |
| 1508 | + |
| 1509 | + |
| 1510 | + |
| 1511 | + |
| 1512 | + |
| 1513 | + |
| 1514 | + |
| 1515 | + |
| 1516 | + |
| 1517 | + |
| 1518 | + |
| 1519 | + |
| 1520 | + |
| 1521 | + |
| 1522 | + |
| 1523 | + |
| 1524 | + |
1489 | 1525 | |
1490 | 1526 | |
1491 | 1527 | |
|
0 commit comments