fix(isMobilePhone): Update bg-BG phone number validation to include phone numbers starting with 098#2586
fix(isMobilePhone): Update bg-BG phone number validation to include phone numbers starting with 098#2586asynchroza wants to merge 3 commits intovalidatorjs:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2586 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2536 2536
Branches 642 642
=========================================
Hits 2536 2536 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
Updates Bulgarian phone number validation to support mobile numbers starting with 098 prefix. This change addresses real-world user issues where valid Bulgarian phone numbers were incorrectly rejected.
- Updated regex pattern to include 098 prefix alongside existing 087/088/089 patterns
- Added comprehensive test cases for the new 098 prefix validation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/lib/isMobilePhone.js | Modified regex pattern to accept 098 prefix for bg-BG locale |
| test/validators.test.js | Added test cases for 098 prefix validation and removed unrelated bn-BD test block |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| }, | ||
| { | ||
|
|
||
| }, |
There was a problem hiding this comment.
Empty test object with no locale, valid, or invalid properties will cause test failures. This should be removed.
I've updated the regex to consider phone numbers starting with 098 as valid.
There are no official statements on the internet besides some forums discussing the validity of this:
We're using this validator on our Bulgarian platform and we had issues with users not being able to enter their phone numbers because they were starting with the 098 combination.
Checklist