util: fix error's namespaced node_modules highlighting using inspect · nodejs/node@b68e0d1 · GitHub
Skip to content

Commit b68e0d1

Browse files
BridgeARtargos
authored andcommitted
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 ebe9272 commit b68e0d1

2 files changed

Lines changed: 41 additions & 13 deletions

File tree

lib/internal/util/inspect.js

Lines changed: 39 additions & 11 deletions

test/parallel/test-util-inspect.js

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)