Skip to content
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

refactor: use replaceAll instead of replace with a regex #80

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

Phillip9587
Copy link
Contributor

Replaced String.prototype.replace with a regex with String.prototype.replaceAll for:

  • Double spaces (/\x20{2}/g)
  • Newlines (/\n/g)

Why?

  • replaceAll is more efficient for direct string replacements
  • Reduces regex overhead

@wesleytodd wesleytodd merged commit 59a45ca into pillarjs:master Feb 10, 2025
8 checks passed
@wesleytodd wesleytodd mentioned this pull request Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants