Skip to content

Commit a032ad1

Browse files
committed
fix(isMobilePhone): update es-PA regex to allow spaces in mobile number format
1 parent 7a56ecd commit a032ad1

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const phones = {
8888
'es-PE': /^(\+?51)?9\d{8}$/,
8989
'es-MX': /^(\+?52)?(1|01)?\d{10,11}$/,
9090
'es-NI': /^(\+?505)\d{7,8}$/,
91-
'es-PA': /^(\+?507)6\d{3}-?\d{4}$/,
91+
'es-PA': /^(\+?507)[-\s]?6\d{3}-?\d{4}$/,
9292
'es-PY': /^(\+?595|0)9[9876]\d{7}$/,
9393
'es-SV': /^(\+?503)?[67]\d{7}$/,
9494
'es-UY': /^(\+598|0)9[1-9][\d]{6}$/,

test/validators.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9592,6 +9592,7 @@ describe('Validators', () => {
95929592
'+50768456789',
95939593
'50762345678',
95949594
'+5076123-4567',
9595+
'+507 6123-4567',
95959596
'+50769876543',
95969597
],
95979598
invalid: [

0 commit comments

Comments
 (0)