Added support for PK(Pakistan) in isIdentityCard by Daniyal-Qureshi · Pull Request #2291 · validatorjs/validator.js
Add a regex pattern for validating valid Pakistani Computerized National Identity Cards (CNICs):
Checklist
- PR contains only changes related; no stray files, etc.
- README updated (where applicable)
- Tests written (where applicable)
- References provided in PR (where applicable)
Codecov Report
All modified and coverable lines are covered by tests ✅
Project coverage is 99.95%. Comparing base (
b958bd7) to head (e46885f).
Report is 33 commits behind head on master.
❗ Current head e46885f differs from pull request most recent head 622e39c
Please upload reports for the commit 622e39c to get more accurate results.
Additional details and impacted files
@@ Coverage Diff @@ ## master #2291 +/- ## ========================================== - Coverage 99.95% 99.95% -0.01% ========================================== Files 107 107 Lines 2454 2453 -1 Branches 619 619 ========================================== - Hits 2453 2452 -1 Partials 1 1
☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use 'PK' as locale instead of 'ur-PK'
What's the source for the regex?
@WikiRik
I've adopted a convention familiar to many developers, using the initial of the national language followed by the initial of the country name. Please Check out the source behind this intriguing regex pattern: CNIC regex format
@WikiRik Hi is there any other fixes needed here.
rubiin
left a comment
•
Loading
rubiin
left a comment
•
Loading
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ur-PK you could simply do as PK as suggested by @WikiRik
rest looks good for merge imo
@rubiin I have changed the local from ur-PK to PK, please review.
Daniyal-Qureshi
changed the title
Added support for ur-PK(Pakistan) in isIdentityCard
Added support for PK(Pakistan) in isIdentityCard
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! 🎉
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters