-
-
Notifications
You must be signed in to change notification settings - Fork 666
fetch: improve regexes in data-uri.js #4483
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: tsctx <[email protected]>
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
This PR improves regex patterns in the data-url.js file to address performance issues identified by SonarJS. The changes focus on optimizing regex patterns and refactoring a for loop to a while loop.
- Adds the
u
flag to regex patterns for better Unicode handling and performance - Optimizes character class ordering and grouping in regex patterns
- Refactors a for loop to a while loop in the percentDecode function
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4483 +/- ##
=======================================
Coverage ? 92.94%
=======================================
Files ? 106
Lines ? 32976
Branches ? 0
=======================================
Hits ? 30649
Misses ? 2327
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sonarjs was reporting some imperformance in the regexes
This relates to...
Rationale
Changes
Features
Bug Fixes
Breaking Changes and Deprecations
Status