FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

isMobilePhone - fixed validation for am-AM by AlexKrupko · Pull Request #2140 · validatorjs/validator.js · GitHub

2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -6631,20 +6631,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

Back | FazBrowse Home | New Git URL