Closed
Description
Version
v23.6.1
Platform
Windows 10
Subsystem
No response
What steps will reproduce the bug?
$ NO_COLOR=1 node -p "JSON.stringify(util.styleText('red', 'red'))"
"red"
$ NO_COLOR=1 node -p "JSON.stringify(util.styleText(['red'], 'red'))"
"\u001b[31mred\u001b[39m"
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
The two commands above should print the same result.
What do you see instead?
Different output.
Additional information
Looking at the implementation.
When the first argument is an array,
Line 132 in 309924f
lazyUtilColors().shouldColorize
, but it's checked when the first argument is a string Line 138 in 309924f
Metadata
Metadata
Assignees
Labels
No labels