Skip to content

Conversation

@Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Aug 28, 2025

sonarjs was reporting some imperformance in the regexes

This relates to...

Rationale

Changes

Features

Bug Fixes

Breaking Changes and Deprecations

Status

Co-authored-by: tsctx <91457664+tsctx@users.noreply.github.com>
@Uzlopak Uzlopak requested a review from Copilot September 6, 2025 06:38
Copy link
Contributor

Copilot AI left a 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.

@metcoder95 metcoder95 requested a review from tsctx September 7, 2025 08:47
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@7321451). Learn more about missing BASE report.

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.
📢 Have feedback on the report? Share it here.

🚀 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.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mcollina mcollina merged commit 4481850 into main Oct 12, 2025
28 of 29 checks passed
@Uzlopak Uzlopak deleted the regex-data-url branch October 12, 2025 08:29
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.

6 participants