Skip to content

Commit f7ff349

Browse files
herejeprofnandaa
authored andcommitted
feat(isMobilePhone): add Frech Polynesia fr-PF locale
Create validation for frech polynesia mobile phones according to wikipedia: https://en.wikipedia.org/wiki/Telephone_numbers_in_French_Polynesia#Mobile
1 parent 8627e48 commit f7ff349

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/lib/isMobilePhone.js

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ const phones = {
8585
'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,
8686
'fr-GP': /^(\+?590|0|00590)[67]\d{8}$/,
8787
'fr-MQ': /^(\+?596|0|00596)[67]\d{8}$/,
88+
'fr-PF': /^(\+?689)?8[789]\d{6}$/,
8889
'fr-RE': /^(\+?262|0|00262)[67]\d{8}$/,
8990
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
9091
'hu-HU': /^(\+?36|06)(20|30|31|50|70)\d{7}$/,

test/validators.js

+22
Original file line numberDiff line numberDiff line change
@@ -6885,6 +6885,28 @@ describe('Validators', () => {
68856885
'+26261245789',
68866886
],
68876887
},
6888+
{
6889+
locale: 'fr-PF',
6890+
valid: [
6891+
'87123456',
6892+
'88123456',
6893+
'89123456',
6894+
'+68987123456',
6895+
'+68988123456',
6896+
'+68989123456',
6897+
'68987123456',
6898+
'68988123456',
6899+
'68989123456',
6900+
],
6901+
invalid: [
6902+
'7123456',
6903+
'86123456',
6904+
'87 12 34 56',
6905+
'definitely not a number',
6906+
'01+68988123456',
6907+
'6898912345',
6908+
],
6909+
},
68886910
{
68896911
locale: 'ka-GE',
68906912
valid: [

0 commit comments

Comments
 (0)