From 97dade24994cbdf35e39913dc1639bcdb4040b6c Mon Sep 17 00:00:00 2001 From: easedu Date: Sat, 7 Mar 2026 18:00:32 -0300 Subject: [PATCH] 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 --- src/lib/isMobilePhone.js | 2 +- test/validators.test.js | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index 84b8fcce0..70ba4bf13 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -149,7 +149,7 @@ const phones = { 'sq-AL': /^(\+355|0)6[2-9]\d{7}$/, 'sr-RS': /^(\+3816|06)[- \d]{5,9}$/, 'sv-SE': /^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/, - 'tg-TJ': /^(\+?992)?[5][5]\d{7}$/, + 'tg-TJ': /^(\+?992)?(00|55|88|90|91|92|93|95|98|99)\d{7}$/, 'th-TH': /^(\+66|66|0)\d{9}$/, 'tr-TR': /^(\+?90|0)?5\d{9}$/, 'tk-TM': /^(\+993|993|8)\d{8}$/, diff --git a/test/validators.test.js b/test/validators.test.js index 010d4fa5a..a23c8daa1 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -10929,6 +10929,16 @@ describe('Validators', () => { '+992553322551', '992553388551', '992553322551', + '+992901234567', + '+992911234567', + '+992001234567', + '+992881234567', + '+992921234567', + '+992931234567', + '+992951234567', + '+992981234567', + '+992991234567', + '992901234567', ], invalid: [ '12345', @@ -10941,6 +10951,8 @@ describe('Validators', () => { '9923633885', '99255363885', '66338855', + '+992801234567', + '+992101234567', ], }, {