Skip to content

Commit

Permalink
fix(isMobilePhone): fixed validation for am-AM (#2140)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKrupko committed Apr 25, 2024
1 parent 19f11cf commit 6b3f62d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Expand Up @@ -2,7 +2,7 @@ import assertString from './util/assertString';

/* eslint-disable max-len */
const phones = {
'am-AM': /^(\+?374|0)((10|[9|7][0-9])\d{6}$|[2-4]\d{7}$)/,
'am-AM': /^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,
'ar-AE': /^((\+?971)|0)?5[024568]\d{7}$/,
'ar-BH': /^(\+?973)?(3|6)\d{7}$/,
'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,
Expand Down
35 changes: 27 additions & 8 deletions test/validators.test.js
Expand Up @@ -6718,20 +6718,39 @@ describe('Validators', () => {
{
locale: 'am-AM',
valid: [
'+37410324123',
'+37422298765',
'+37431276521',
'022698763',
'37491987654',
'+37494567890',
'+37433123456',
'+37441123456',
'+37443123456',
'+37444123456',
'+37455123456',
'+37477123456',
'+37488123456',
'+37491123456',
'+37493123456',
'+37494123456',
'+37495123456',
'+37496123456',
'+37498123456',
'+37499123456',
'055123456',
'37455123456',
],
invalid: [
'12345',
'+37411498855',
'+37411498123',
'+37403498855',
'+37416498123',
'05614988556',
'',
'37456789000',
'37486789000',
'+37431312345',
'+37430312345',
'+37460123456',
'+37410324123',
'+37422298765',
'+37431276521',
'022698763',
'+37492123456',
],
},
{
Expand Down

0 comments on commit 6b3f62d

Please sign in to comment.