Skip to content

Commit

Permalink
feat(isMobilePhone): add fr-CF locale (#2176)
Browse files Browse the repository at this point in the history
Co-authored-by: cheboi <moscheb96gmail.com>
  • Loading branch information
cheboi committed Feb 8, 2023
1 parent ecce35f commit 7cda875
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const phones = {
'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
'en-JM': /^(\+?876)?\d{7}$/,
'en-KE': /^(\+?254|0)(7|1)\d{8}$/,
'fr-CF': /^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,
'en-SS': /^(\+?211|0)(9[1257])\d{7}$/,
'en-KI': /^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,
'en-KN': /^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,
Expand Down
25 changes: 25 additions & 0 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7404,6 +7404,31 @@ describe('Validators', () => {
'+254800723845',
],
},
{
locale: 'fr-CF',
valid: [
'+23670850000',
'+23675038756',
'+23677859002',
'+23672854202',
'+23621854052',
'+23622854072',
'72234650',
'70045902',
'77934567',
'21456794',
'22452389',
],
invalid: [
'+23689032',
'123456789',
'+236723845987',
'022452389',
'+236772345678',
'+236700456794',

],
},
{
locale: 'en-KI',
valid: [
Expand Down

0 comments on commit 7cda875

Please sign in to comment.