Skip to content

Commit 97dade2

Browse files
committed
fix(isMobilePhone): update tg-TJ locale to include all valid operator codes
Add missing operator codes 90 and 91 to Tajikistan mobile phone regex. Updated regex now covers all valid codes: 00, 55, 88, 90, 91, 92, 93, 95, 98, 99. Closes #2544
1 parent b1aea75 commit 97dade2

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/lib/isMobilePhone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const phones = {
149149
'sq-AL': /^(\+355|0)6[2-9]\d{7}$/,
150150
'sr-RS': /^(\+3816|06)[- \d]{5,9}$/,
151151
'sv-SE': /^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,
152-
'tg-TJ': /^(\+?992)?[5][5]\d{7}$/,
152+
'tg-TJ': /^(\+?992)?(00|55|88|90|91|92|93|95|98|99)\d{7}$/,
153153
'th-TH': /^(\+66|66|0)\d{9}$/,
154154
'tr-TR': /^(\+?90|0)?5\d{9}$/,
155155
'tk-TM': /^(\+993|993|8)\d{8}$/,

test/validators.test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10929,6 +10929,16 @@ describe('Validators', () => {
1092910929
'+992553322551',
1093010930
'992553388551',
1093110931
'992553322551',
10932+
'+992901234567',
10933+
'+992911234567',
10934+
'+992001234567',
10935+
'+992881234567',
10936+
'+992921234567',
10937+
'+992931234567',
10938+
'+992951234567',
10939+
'+992981234567',
10940+
'+992991234567',
10941+
'992901234567',
1093210942
],
1093310943
invalid: [
1093410944
'12345',
@@ -10941,6 +10951,8 @@ describe('Validators', () => {
1094110951
'9923633885',
1094210952
'99255363885',
1094310953
'66338855',
10954+
'+992801234567',
10955+
'+992101234567',
1094410956
],
1094510957
},
1094610958
{

0 commit comments

Comments
 (0)