-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
feat(isIdentityCard): Add PL locale #1745
feat(isIdentityCard): Add PL locale #1745
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1745 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 102 102
Lines 2015 2027 +12
Branches 454 456 +2
=========================================
+ Hits 2015 2027 +12
Continue to review full report at Codecov.
|
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.
Does it have anything to do with isIdentityCard
? I am quite in disagreement with adding a specific validator for a specific country code.
I checked and it would fit there. I will add this PESEL validator to isIdentityCard. |
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.
Thank you for your PR @wiktorwojcik112
Totally agree with @fedeci this validator should be added as a locale to isIdentityCard
. Please make the necessary changes and add tests for the uncovered line in your code
Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>
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.
Thank you for updating your PR @wiktorwojcik112 can you please fix the linter issue and add the missing test cases to bring back coverage to 100%.
I suggest you run tests locally before pushing new code (using yarn test
or npm run test
)
EDIT: Can you please change the PR title to specify you are adding a new locale to isIdentityCard
and not a new validator (The PR title will be the commit message when the PR is merged and the actual title is misleading)
Ok. I fixed linter error and changed title, but I still can't figure out how to solve coverage issue. |
That's tricky but you need to find a test example where the last digit of PESEL number equals 10 minus your modulo. |
Everything should be good now. |
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.
Thank you @wiktorwojcik112 can you please address my latest comment concerning istanbul ignore else
?
Co-authored-by: Sarhan Aissi <tux-tn@users.noreply.github.com>
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.
LGTM 🎉 Thank you for taking the time to quickly address all the comments
It was nice working with you. Thank you all for help. Take care! |
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.
LGTM. thanks for your contrib! 🎉
Add isPESEL validation.
PESEL is a polish national identification number. Validator checks whether provided string follows criteria of
valid PESEL.
Checklist