Skip to content

Commit 66ddd9c

Browse files
sadralievrubiin
andauthored
feat(isMobilePhone): add validation for Kyrgyzstan [ky-KG] mobile phone numbers (#2350)
Co-authored-by: Rubin Bhandari <[email protected]>
1 parent ff56dcf commit 66ddd9c

File tree

2 files changed

+39
-10
lines changed

2 files changed

+39
-10
lines changed

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const phones = {
119119
'kk-KZ': /^(\+?7|8)?7\d{9}$/,
120120
'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
121121
'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
122-
'ky-KG': /^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,
122+
'ky-KG': /^(\+996\s?)?(22[0-9]|50[0-9]|55[0-9]|70[0-9]|75[0-9]|77[0-9]|880|990|995|996|997|998)\s?\d{3}\s?\d{3}$/,
123123
'lt-LT': /^(\+370|8)\d{8}$/,
124124
'lv-LV': /^(\+?371)2\d{7}$/,
125125
'mg-MG': /^((\+?261|0)(2|3)\d)?\d{7}$/,

test/validators.test.js

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9536,15 +9536,44 @@ describe('Validators', () => {
95369536
{
95379537
locale: 'ky-KG',
95389538
valid: [
9539-
'+7 727 123 4567',
9540-
'+7 714 2396102',
9541-
'77271234567',
9542-
'0271234567',
9543-
],
9544-
invalid: [
9545-
'02188565377',
9546-
'09386932778',
9547-
'0938693277vadggjdsaasdgj8',
9539+
'+996553033300',
9540+
'+996 222 123456',
9541+
'+996 500 987654',
9542+
'+996 555 111222',
9543+
'+996 700 333444',
9544+
'+996 770 555666',
9545+
'+996 880 777888',
9546+
'+996 990 999000',
9547+
'+996 995 555666',
9548+
'+996 996 555666',
9549+
'+996 997 555666',
9550+
'+996 998 555666',
9551+
],
9552+
invalid: [
9553+
'+996 201 123456',
9554+
'+996 312 123456',
9555+
'+996 3960 12345',
9556+
'+996 3961 12345',
9557+
'+996 3962 12345',
9558+
'+996 3963 12345',
9559+
'+996 3964 12345',
9560+
'+996 3965 12345',
9561+
'+996 3966 12345',
9562+
'+996 3967 12345',
9563+
'+996 3968 12345',
9564+
'+996 511 123456',
9565+
'+996 522 123456',
9566+
'+996 561 123456',
9567+
'+996 571 123456',
9568+
'+996 624 123456',
9569+
'+996 623 123456',
9570+
'+996 622 123456',
9571+
'+996 609 123456',
9572+
'+996 100 12345',
9573+
'+996 100 1234567',
9574+
'996 100 123456',
9575+
'0 100 123456',
9576+
'0 100 123abc',
95489577
],
95499578
},
95509579
{

0 commit comments

Comments
 (0)