Title: util: fix styleText to accept format aliases by himself65 · Pull Request #62191 · nodejs/node · GitHub
Open Graph Title: util: fix styleText to accept format aliases by himself65 · Pull Request #62191 · nodejs/node
X Title: util: fix styleText to accept format aliases by himself65 · Pull Request #62191 · nodejs/node
Description: The optimization in #61792 introduced a style cache using ObjectKeys(inspect.colors), which only returns enumerable properties. Color aliases (e.g. 'grey', 'blackBright', 'faint') are defined as non-enumerable via defineColorAlias(), so they were excluded from the cache, causing ERR_INVALID_ARG_VALUE when used with styleText(). Replace ObjectKeys with ObjectGetOwnPropertyNames to include non-enumerable alias properties in both the style cache and the validation error message. Fixes: #62177
Open Graph Description: The optimization in #61792 introduced a style cache using ObjectKeys(inspect.colors), which only returns enumerable properties. Color aliases (e.g. 'grey', 'blackBright', 'faint...
X Description: The optimization in #61792 introduced a style cache using ObjectKeys(inspect.colors), which only returns enumerable properties. Color aliases (e.g. 'grey', 'blackBright&...
Opengraph URL: https://github.com/nodejs/node/pull/62191
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ef63179f-f002-098b-e495-052f042e26ba |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | DCB4:70BDC:37EE2D:4CA1DE:6A4C7D09 |
| html-safe-nonce | 1be77c2b6733ecada942310779876cfb94dc450412fe61c6765ded7271bac5a4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQ0I0OjcwQkRDOjM3RUUyRDo0Q0ExREU6NkE0QzdEMDkiLCJ2aXNpdG9yX2lkIjoiNzA2ODY2NDQxMDI2NTEyNDEwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 58b54a43741362a37690d2a24238b01148af490fc9eefedd13cb6cc2ed65124c |
| hovercard-subject-tag | pull_request:3380577461 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodejs/node/pull/62191/files |
| twitter:image | https://avatars.githubusercontent.com/u/14026360?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/14026360?s=400&v=4 |
| og:image:alt | The optimization in #61792 introduced a style cache using ObjectKeys(inspect.colors), which only returns enumerable properties. Color aliases (e.g. 'grey', 'blackBright', 'faint... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cd470457e909b9d062f8002cf438ba870e6acff6 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width