We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
util.styleText
NO_COLOR
v23.6.1
Windows 10
No response
$ 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"
Always
The two commands above should print the same result.
Different output.
Looking at the implementation.
When the first argument is an array,
node/lib/util.js
Line 132 in 309924f
lazyUtilColors().shouldColorize
Line 138 in 309924f
The text was updated successfully, but these errors were encountered:
f4fba08
util: enforce shouldColorize in styleText array arg
77294d8
PR-URL: #56722 Fixes: #56717 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Deokjin Kim <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Successfully merging a pull request may close this issue.
Version
v23.6.1
Platform
Subsystem
No response
What steps will reproduce the bug?
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,
node/lib/util.js
Line 132 in 309924f
lazyUtilColors().shouldColorize
, but it's checked when the first argument is a stringnode/lib/util.js
Line 138 in 309924f
The text was updated successfully, but these errors were encountered: