Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.4k
feat(isPassportNumber): fix regex for CN#1714
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Codecov Report
@@ Coverage Diff @@## master #1714 +/- ##========================================= Coverage 100.00% 100.00% ========================================= Files 101 101 Lines 2005 2005 Branches 452 452 ========================================= Hits 2005 2005
Continue to review full report at Codecov.
|
Bump! |
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.
Really sorry for the long delay@anirudhgiri ! Thank you for your PR 🎉
LGTM !
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! 🎉
Fixes#1686
The format for passport numbers for CN passports are as follows:
Valid Examples:
So the above conditions were implemented with the following regex :
^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$
The appropriate testes were added to validators.js with all of them passing.
Checklist