Skip to content

Commit cae12c9

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 09ad4a0 commit cae12c9

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
@@ -83,6 +83,7 @@ const phones = {
8383
'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,
8484
'fr-GP': /^(\+?590|0|00590)[67]\d{8}$/,
8585
'fr-MQ': /^(\+?596|0|00596)[67]\d{8}$/,
86+
'fr-PF': /^(\+?689)?8[789]\d{6}$/,
8687
'fr-RE': /^(\+?262|0|00262)[67]\d{8}$/,
8788
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
8889
'hu-HU': /^(\+?36|06)(20|30|31|50|70)\d{7}$/,

test/validators.js

+22
Original file line numberDiff line numberDiff line change
@@ -6860,6 +6860,28 @@ describe('Validators', () => {
68606860
'+26261245789',
68616861
],
68626862
},
6863+
{
6864+
locale: 'fr-PF',
6865+
valid: [
6866+
'87123456',
6867+
'88123456',
6868+
'89123456',
6869+
'+68987123456',
6870+
'+68988123456',
6871+
'+68989123456',
6872+
'68987123456',
6873+
'68988123456',
6874+
'68989123456',
6875+
],
6876+
invalid: [
6877+
'7123456',
6878+
'86123456',
6879+
'87 12 34 56',
6880+
'definitely not a number',
6881+
'01+68988123456',
6882+
'6898912345',
6883+
],
6884+
},
68636885
{
68646886
locale: 'ka-GE',
68656887
valid: [

0 commit comments

Comments
 (0)