Skip to content

Commit ade3997

Browse files
fix(isMobilePhone): update tg-TJ regex to cover all valid Tajikistan operator codes
Previous regex only matched the 55 prefix. Updated to include all valid mobile operator codes (00, 55, 88, 90, 91, 92, 93, 95, 98, 99) per the WFP Logistics Cluster telecommunications reference for Tajikistan. Fixes #2544 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9fa1e3a commit ade3997

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

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|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: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10929,6 +10929,17 @@ describe('Validators', () => {
1092910929
'+992553322551',
1093010930
'992553388551',
1093110931
'992553322551',
10932+
'+992901234567',
10933+
'+992911234567',
10934+
'+992921234567',
10935+
'+992931234567',
10936+
'+992951234567',
10937+
'+992981234567',
10938+
'+992991234567',
10939+
'+992881234567',
10940+
'+992001234567',
10941+
'901234567',
10942+
'911234567',
1093210943
],
1093310944
invalid: [
1093410945
'12345',
@@ -10941,6 +10952,9 @@ describe('Validators', () => {
1094110952
'9923633885',
1094210953
'99255363885',
1094310954
'66338855',
10955+
'+992941234567',
10956+
'+992961234567',
10957+
'+992971234567',
1094410958
],
1094510959
},
1094610960
{

0 commit comments

Comments
 (0)