Skip to content

Commit

Permalink
chore: make ddd optional and update phone number format
Browse files Browse the repository at this point in the history
  • Loading branch information
renaldodev committed Dec 31, 2024
1 parent 86911d8 commit 1be7ad3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const phones = {
'pl-PL': /^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,
'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}))$/,
'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
'pt-AO': /^(\+244)\d{9}$/,
'pt-AO': /^(\+?244)?9\d{8}$/,
'ro-MD': /^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,
'ro-RO': /^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,
'ru-RU': /^(\+?7|8)?9\d{9}$/,
Expand Down
4 changes: 3 additions & 1 deletion test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10365,10 +10365,12 @@ describe('Validators', () => {
locale: 'pt-AO',
valid: [
'+244911123432',
'+244123091232',
'911123432',
'244911123432',
],
invalid: [
'+2449111234321',
'+244811123432',
'31234',
'31234567',
'512345',
Expand Down

0 comments on commit 1be7ad3

Please sign in to comment.