Skip to content

Commit

Permalink
feat(isMobilePhone): add Frech Polynesia fr-PF locale
Browse files Browse the repository at this point in the history
Create validation for frech polynesia mobile phones according to wikipedia:

https://en.wikipedia.org/wiki/Telephone_numbers_in_French_Polynesia#Mobile
  • Loading branch information
hereje authored and profnandaa committed Oct 31, 2021
1 parent 8627e48 commit f7ff349
Show file tree
Hide file tree
Showing 2 changed files with 23 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 @@ -85,6 +85,7 @@ const phones = {
'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,
'fr-GP': /^(\+?590|0|00590)[67]\d{8}$/,
'fr-MQ': /^(\+?596|0|00596)[67]\d{8}$/,
'fr-PF': /^(\+?689)?8[789]\d{6}$/,
'fr-RE': /^(\+?262|0|00262)[67]\d{8}$/,
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
'hu-HU': /^(\+?36|06)(20|30|31|50|70)\d{7}$/,
Expand Down
22 changes: 22 additions & 0 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -6885,6 +6885,28 @@ describe('Validators', () => {
'+26261245789',
],
},
{
locale: 'fr-PF',
valid: [
'87123456',
'88123456',
'89123456',
'+68987123456',
'+68988123456',
'+68989123456',
'68987123456',
'68988123456',
'68989123456',
],
invalid: [
'7123456',
'86123456',
'87 12 34 56',
'definitely not a number',
'01+68988123456',
'6898912345',
],
},
{
locale: 'ka-GE',
valid: [
Expand Down

0 comments on commit f7ff349

Please sign in to comment.