-
-
Notifications
You must be signed in to change notification settings - Fork 939
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
chore: improve regex usage #2108
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## next #2108 +/- ##
==========================================
- Coverage 99.59% 99.59% -0.01%
==========================================
Files 2567 2567
Lines 243394 243371 -23
Branches 1254 1252 -2
==========================================
- Hits 242420 242396 -24
- Misses 947 948 +1
Partials 27 27
|
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.
🤷
May I ask what the value of this reaction was intended? If you want to understand why this PR, please just gentle ask for it string.match(RegExp) bleeds to an token.index that can potentially undefined beside that RegExp.test(string) just returns a boolean instead of Result|null, so the thrown away overhead is reduced |
The intention behind this comment was originally to point out that some of your PR descriptions - especially for those PRs that dont fix an obvious bug - tend to be on a the shorter side and omit the part containing the intend and reasoning. I had also hoped that during the talk about this change I had successfully conveijed how unsure I am regarding the two methods and their differences. |
i think this could be split into two. Seems like you are doing two things...
|
I don't think this is necessary, as they are close enough.
There is a type difference there that avoid an issue in combination with the PR mentioned above. |
extracted #2102
Changes the usage of regexp to always follow
RegExp#method(string)
.As a side effect this fixes some potential null value type issues currently hidden by our tsconfig.