Commit 9e8beff
util: fix error's namespaced node_modules highlighting using inspect
When inspecting errors, node_modules are highlighted with an
underscore. So far namespaced modules only highlighted the namespace
but not the rest of the module name. This is fixed by matching the
full name.
As drive-by it improves the performance slightly by removing the
regular expression in favor of indexOf to identify the right spot.
PR-URL: #59446
Reviewed-By: Jordan Harband <ljharb@gmail.com>1 parent b8d145d commit 9e8beffCopy full SHA for 9e8beff
File tree
Expand file treeCollapse file tree
2 files changed
+41
-13
lines changedOpen diff view settings
Filter options
- lib/internal/util
- test/parallel
Expand file treeCollapse file tree
2 files changed
+41
-13
lines changedOpen diff view settings
Collapse file
lib/internal/util/inspect.js
Copy file name to clipboardExpand all lines: lib/internal/util/inspect.js+39-11Lines changed: 39 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
212 | 212 | |
213 | 213 | |
214 | 214 | |
215 | | - |
216 | 215 | |
217 | 216 | |
218 | 217 | |
| ||
1339 | 1338 | |
1340 | 1339 | |
1341 | 1340 | |
1342 | | - |
1343 | | - |
1344 | | - |
1345 | | - |
1346 | | - |
1347 | | - |
1348 | | - |
1349 | | - |
1350 | | - |
1351 | | - |
| 1341 | + |
| 1342 | + |
| 1343 | + |
| 1344 | + |
| 1345 | + |
| 1346 | + |
| 1347 | + |
| 1348 | + |
| 1349 | + |
| 1350 | + |
| 1351 | + |
| 1352 | + |
| 1353 | + |
| 1354 | + |
| 1355 | + |
| 1356 | + |
| 1357 | + |
| 1358 | + |
| 1359 | + |
| 1360 | + |
| 1361 | + |
| 1362 | + |
| 1363 | + |
| 1364 | + |
| 1365 | + |
| 1366 | + |
| 1367 | + |
| 1368 | + |
| 1369 | + |
| 1370 | + |
| 1371 | + |
| 1372 | + |
| 1373 | + |
| 1374 | + |
| 1375 | + |
| 1376 | + |
| 1377 | + |
| 1378 | + |
| 1379 | + |
1352 | 1380 | |
1353 | 1381 | |
1354 | 1382 | |
|
Collapse file
test/parallel/test-util-inspect.js
Copy file name to clipboardExpand all lines: test/parallel/test-util-inspect.js+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2833 | 2833 | |
2834 | 2834 | |
2835 | 2835 | |
2836 | | - |
| 2836 | + |
2837 | 2837 | |
2838 | 2838 | |
2839 | 2839 | |
| ||
2858 | 2858 | |
2859 | 2859 | |
2860 | 2860 | |
2861 | | - |
| 2861 | + |
2862 | 2862 | |
2863 | 2863 | |
2864 | 2864 | |
|
0 commit comments