Skip to content

util: allow color aliases in styleText#62180

Open
Han5991 wants to merge 2 commits intonodejs:mainfrom
Han5991:fix/62177-util-styletext-aliases
Open

util: allow color aliases in styleText#62180
Han5991 wants to merge 2 commits intonodejs:mainfrom
Han5991:fix/62177-util-styletext-aliases

Conversation

@Han5991
Copy link
Contributor

@Han5991 Han5991 commented Mar 10, 2026

Fixes an issue where util.styleText() would throw an error for valid color aliases like 'grey' in Node.js >= 25.7.0. It now uses ObjectGetOwnPropertyNames instead of ObjectKeys to fetch both keys and aliases.

Fixes: #62177

Fixes an issue where `util.styleText()` would throw an error for
valid color aliases like 'grey' in Node.js >= 25.7.0. It now uses
`ObjectGetOwnPropertyNames` instead of `ObjectKeys` to fetch both
keys and aliases.

Fixes: nodejs#62177
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. util Issues and PRs related to the built-in util module. labels Mar 10, 2026
@Renegade334 Renegade334 added request-ci Add this label to start a Jenkins CI on a PR. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Mar 10, 2026
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.66%. Comparing base (a0d8ea4) to head (42b2f62).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62180      +/-   ##
==========================================
- Coverage   91.63%   89.66%   -1.98%     
==========================================
  Files         337      676     +339     
  Lines      140591   206551   +65960     
  Branches    21787    39542   +17755     
==========================================
+ Hits       128831   185199   +56368     
- Misses      11537    13482    +1945     
- Partials      223     7870    +7647     
Files with missing lines Coverage Δ
lib/util.js 93.58% <100.00%> (+0.01%) ⬆️

... and 462 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 10, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot
Copy link
Collaborator

@Han5991 Han5991 force-pushed the fix/62177-util-styletext-aliases branch from 33b7996 to 42b2f62 Compare March 10, 2026 21:46
@himself65 himself65 added request-ci Add this label to start a Jenkins CI on a PR. and removed needs-ci PRs that need a full CI run. labels Mar 10, 2026
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Mar 10, 2026
@github-actions
Copy link
Contributor

Failed to start CI
   ⚠  Commits were pushed since the last approving review:
   ⚠  - util: allow color aliases in styleText
   ⚠  - test: add alias tests for util.styleText
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/22925990713

@Han5991
Copy link
Contributor Author

Han5991 commented Mar 10, 2026

@himself65

Could you please take a look at the ci failure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

util.styleText() does not accept format aliases on Node.js >= 25.7.0

4 participants