Skip to content
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: (isMobilePhone) Add mobile phone validation for Cameroon (fr-CM) #1772

Merged
merged 11 commits into from
Oct 31, 2021
1 change: 1 addition & 0 deletions src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const phones = {
'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,
'fj-FJ': /^(\+?679)?\s?\d{3}\s?\d{4}$/,
'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
'fr-CM': /^(\+?237)6[0-9]{8}$/,
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,
'fr-GP': /^(\+?590|0|00590)[67]\d{8}$/,
Expand Down
15 changes: 15 additions & 0 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -7568,6 +7568,21 @@ describe('Validators', () => {
'088-320000',
],
},
{
locale: 'fr-CM',
valid: [
'+237677936141',
'237623456789',
'+237698124842',
'237693029202',
],
invalid: [
'NotANumber',
'+(703)-572-2920',
'+237 623 45 67 890',
'+2379981247429',
],
},
{
locale: 'ko-KR',
valid: [
Expand Down