AlaskaAirlines / WC-Generator

Auro's automated web component generator
https://auro.alaskaair.com/getting-started/developers/generator/install
Apache License 2.0
5 stars 9 forks source link

Update inefficient RegEx #357 #494

Closed fajar-apri-alaska closed 7 months ago

fajar-apri-alaska commented 7 months ago

Alaska Airlines Pull Request

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Resolves: #357

Summary:

  1. The \r\n is redundant to \r checking in current pattern, and I think we can combine it with the \n checking by using \r?\n
  2. At first, I want to also remove the standalone \r because it only for older Mac OS, but I think we should keep it for backward compatibility, so adding | \r to the pattern.
  3. Additional (?!\n) in the end is to make sure the \r is not followed by \n, to avoid exponential backtracking on strings starting with ''' and containing many repetitions of '\r\n'. (per latest CodeQL analysis alert https://github.com/AlaskaAirlines/WC-Generator/security/code-scanning/3)

Type of change:

Please delete options that are not relevant.

Checklist:

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!
-- Auro Design System Team

blackfalcon commented 7 months ago

:tada: This PR is included in version 4.4.10 :tada:

The release is available on:

Your semantic-release bot :package::rocket: