-
-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -72,5 +72,8 @@ | |||||||||||
"engines": { | ||||||||||||
"node": ">= 0.10" | ||||||||||||
}, | ||||||||||||
"license": "MIT" | ||||||||||||
"license": "MIT", | ||||||||||||
"dependencies": { | ||||||||||||
"validator": "^13.11.0" | ||||||||||||
} | ||||||||||||
Comment on lines
+75
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
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) Please also move this to it's proper alphabetical location, like in the README. |
||||||
}; | ||||||
/* eslint-enable max-len */ | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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? |
||
}; | ||
|
||
export const locales = Object.keys(patterns); | ||
|
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 ofisPostalCode
as well