-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
chore: replace strip-ansi with util.stripVTControlCharacters
#5267
New issue
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
Conversation
The committers listed above are authorized under a signed CLA. |
Indeed, still in triage. I want to wait and see if the other members of @mochajs/maintenance-crew have inputs. Marking this PR as a draft in the meantime. Thanks for sending! |
|
Nobody posted and this seems like a pretty straightforward dependency-to-builtin swap. I marked the issue as accepting PRs. Let's do this! 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Great, glad it's such a straightforward swap-out!
I ran this locally and confirmed http://localhost:8080/#command-line-usage still has control characters stripped out.
strip-ansi with util.stripVTControlCharactersstrip-ansi with util.stripVTControlCharacters
strip-ansi with util.stripVTControlCharactersstrip-ansi with util.stripVTControlCharacters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Replaces the external strip-ansi dependency with Node’s built-in util.stripVTControlCharacters for stripping ANSI/VTE control codes.
- Removed
strip-ansifrom devDependencies inpackage.json - Updated the usage example in
docs/_data/usage.jsto import and callstripVTControlCharactersfrom the Nodeutilmodule
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| package.json | Removed the obsolete strip-ansi entry |
| docs/_data/usage.js | Swapped out strip-ansi for util.stripVTControlCharacters |
Comments suppressed due to low confidence (1)
package.json:164
- Since
util.stripVTControlCharactersis only available in Node.js v16.9.0 and later, consider updating theenginesfield inpackage.jsonto enforce a minimum Node.js version, preventing unexpected build or runtime errors.
"strip-ansi": "^6.0.0",
PR Checklist
util.stripVTControlCharacters#5265status: accepting prsOverview
Replaced
strip-ansiwithutil.stripVTControlCharacters