-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
regex added for Senegal sn-SN #2304
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2304 +/- ##
==========================================
- Coverage 99.95% 99.95% -0.01%
==========================================
Files 107 107
Lines 2454 2449 -5
Branches 619 619
==========================================
- Hits 2453 2448 -5
Partials 1 1
☔ View full report in Codecov by Sentry. |
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.
Please add SN
to the list of locales of isPostalCode
as well
"license": "MIT", | ||
"dependencies": { | ||
"validator": "^13.11.0" | ||
} |
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.
"license": "MIT", | |
"dependencies": { | |
"validator": "^13.11.0" | |
} | |
"license": "MIT" |
@@ -73,6 +73,7 @@ const patterns = { | |||
US: /^\d{5}(-\d{4})?$/, | |||
ZA: fourDigit, | |||
ZM: fiveDigit, | |||
SN: fiveDigit, |
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.
Please add tests for this as well. Also; can you provide a source for this?
@@ -159,6 +159,7 @@ const phones = { | |||
'ar-YE': /^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/, | |||
'ar-EH': /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/, | |||
'fa-AF': /^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/, | |||
'sn-SN': /^(221|00221|\+221)?(77|78|75|70|76)[0-9]{7}$/, |
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.
'sn-SN': /^(221|00221|\+221)?(77|78|75|70|76)[0-9]{7}$/, | |
'sn-SN': /^(\+?221|0)?(70|72|7[5-9])[0-9]{7}$/, |
According to the most recent document in https://www.itu.int/oth/T02020000B8/en , this should be the regular expression. I have also updated the first part to be more in line with other locales (even though there are major inconsistencies)
Tests should also be updated for this
Please also move this to it's proper alphabetical location, like in the README.
Validations added for Senegal - Issue #1761
CHECKLIST