Skip to content

Commit aacf9b5

Browse files
authored
chore: make ddd optional and update phone number format (#2512)
1 parent ab18093 commit aacf9b5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const phones = {
136136
'pl-PL': /^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,
137137
'pt-BR': /^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,
138138
'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
139-
'pt-AO': /^(\+244)\d{9}$/,
139+
'pt-AO': /^(\+?244)?9\d{8}$/,
140140
'ro-MD': /^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,
141141
'ro-RO': /^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,
142142
'ru-RU': /^(\+?7|8)?9\d{9}$/,

test/validators.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10162,10 +10162,12 @@ describe('Validators', () => {
1016210162
locale: 'pt-AO',
1016310163
valid: [
1016410164
'+244911123432',
10165-
'+244123091232',
10165+
'911123432',
10166+
'244911123432',
1016610167
],
1016710168
invalid: [
1016810169
'+2449111234321',
10170+
'+244811123432',
1016910171
'31234',
1017010172
'31234567',
1017110173
'512345',

0 commit comments

Comments
 (0)