util: fix stylize of special properties in inspect · nodejs/node@7ec04cf · GitHub
Skip to content

Commit 7ec04cf

Browse files
Snowflytaduh95
authored andcommitted
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 273c966 commit 7ec04cf

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

lib/internal/util/inspect.js

Lines changed: 2 additions & 1 deletion

test/parallel/test-util-inspect.js

Lines changed: 14 additions & 0 deletions

0 commit comments

Comments
 (0)