Skip to content

Commit 6b3f62d

Browse files
authored
fix(isMobilePhone): fixed validation for am-AM (#2140)
1 parent 19f11cf commit 6b3f62d

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import assertString from './util/assertString';
22

33
/* eslint-disable max-len */
44
const phones = {
5-
'am-AM': /^(\+?374|0)((10|[9|7][0-9])\d{6}$|[2-4]\d{7}$)/,
5+
'am-AM': /^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,
66
'ar-AE': /^((\+?971)|0)?5[024568]\d{7}$/,
77
'ar-BH': /^(\+?973)?(3|6)\d{7}$/,
88
'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,

test/validators.test.js

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6718,20 +6718,39 @@ describe('Validators', () => {
67186718
{
67196719
locale: 'am-AM',
67206720
valid: [
6721-
'+37410324123',
6722-
'+37422298765',
6723-
'+37431276521',
6724-
'022698763',
6725-
'37491987654',
6726-
'+37494567890',
6721+
'+37433123456',
6722+
'+37441123456',
6723+
'+37443123456',
6724+
'+37444123456',
6725+
'+37455123456',
6726+
'+37477123456',
6727+
'+37488123456',
6728+
'+37491123456',
6729+
'+37493123456',
6730+
'+37494123456',
6731+
'+37495123456',
6732+
'+37496123456',
6733+
'+37498123456',
6734+
'+37499123456',
6735+
'055123456',
6736+
'37455123456',
67276737
],
67286738
invalid: [
67296739
'12345',
6730-
'+37411498855',
6731-
'+37411498123',
6740+
'+37403498855',
6741+
'+37416498123',
67326742
'05614988556',
67336743
'',
67346744
'37456789000',
6745+
'37486789000',
6746+
'+37431312345',
6747+
'+37430312345',
6748+
'+37460123456',
6749+
'+37410324123',
6750+
'+37422298765',
6751+
'+37431276521',
6752+
'022698763',
6753+
'+37492123456',
67356754
],
67366755
},
67376756
{

0 commit comments

Comments
 (0)