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

fix(isPostalCode): Fix overly permissive BY regexp #2134

Merged
merged 2 commits into from Jan 22, 2023

Conversation

pano9000
Copy link
Contributor

  • add missing start of line anchor ^
  • remove meaningless {1} quantifier

Fixes #2133

Checklist

  • PR contains only changes related; no stray files, etc.
  • [ ] README updated (where applicable)
  • [ ] Tests written (where applicable)

* add missing start of line anchor
* remove meaningless `{1}` quantifier

Fixes validatorjs#2133
@codecov
Copy link

codecov bot commented Dec 19, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (843584e) compared to base (531dc7f).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2134   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          104       104           
  Lines         2308      2308           
  Branches       578       578           
=========================================
  Hits          2308      2308           
Impacted Files Coverage Δ
src/lib/isPostalCode.js 100.00% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@WikiRik
Copy link
Member

WikiRik commented Dec 20, 2022

Maybe add a test for postal codes that are now marked as invalid?

@pano9000
Copy link
Contributor Author

had to add a full block of "invalid" tests, because for some reason, there were none to begin with :-(
(which is why I also originally did not include those invalid tests in my PR)

@rubiin rubiin added ready-to-land For PRs that are reviewed and ready to be landed ✅ LGTM labels Jan 21, 2023
Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

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

LGTM

@profnandaa profnandaa merged commit 7bef722 into validatorjs:master Jan 22, 2023
@pano9000 pano9000 deleted the fix_isPostalCode_BY_#2133 branch January 23, 2023 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ LGTM ready-to-land For PRs that are reviewed and ready to be landed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

isPostalCode: Belarus (BY) RegExp is too permissive, matches invalid postal codes
4 participants