feat(isMobilePhone): add fr-ML (Mali) and fr-TG (Togo) locales#2691
feat(isMobilePhone): add fr-ML (Mali) and fr-TG (Togo) locales#2691tranhoangtu-it wants to merge 5 commits intovalidatorjs:masterfrom
Conversation
Add mobile phone number validation for Mali (fr-ML) and Togo (fr-TG).
Mali (+223):
- Mobile operators: Orange (7x), Malitel (6x, 9x)
- Pattern: /^(\+?223)?[679]\d{7}$/
- Based on ITU-T numbering plan for Mali
Togo (+228):
- Mobile operators: Togocel (70-73, 90-93), Moov (78-79, 96-99)
- Excludes non-existent prefixes 74-77 and 94-95
- Pattern: /^(\+?228)?(7([0-3]|[89])|9([0-3]|[6-9]))\d{6}$/
- Based on ITU-T numbering plan for Togo
Closes validatorjs#1761
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2691 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2595 2595
Branches 659 659
=========================================
Hits 2595 2595 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds isMobilePhone validation support for Mali (fr-ML) and Togo (fr-TG) and updates tests/docs accordingly (per #1761).
Changes:
- Add
fr-MLandfr-TGregexes tosrc/lib/isMobilePhone.js - Add valid/invalid test vectors for both locales in
test/validators.test.js - Document the new locales in the README supported locale list
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/lib/isMobilePhone.js | Adds regex patterns for fr-ML and fr-TG locales |
| test/validators.test.js | Adds locale-specific valid/invalid cases for Mali and Togo |
| README.md | Adds fr-ML / fr-TG to the documented locale list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Thanks for the review feedback! Addressing both issues:
Pushing fix shortly. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@rubiin All review feedback has been addressed:
Ready for re-review. |
|
Done! Synced the README \ locale list with the actual source (163 locales). The second locale list in README was missing several locales and had some that didn't exist in source — now both lists are in sync. |
Summary
Adds mobile phone number validation for two West African French-speaking countries, contributing to issue #1761.
Mali (
fr-ML) — country code +223Mobile operators and their prefixes:
7x6x,9xRegex:
/^(\+?223)?[679]\d{7}$/Reference: ITU-T Mali Numbering Plan
Togo (
fr-TG) — country code +228Mobile operators and their allocated prefixes:
70–73,90–9378–79,96–9974–77and94–95are not allocatedRegex:
/^(\+?228)?(7([0-3]|[89])|9([0-3]|[6-9]))\d{6}$/Reference: ITU-T Togo Numbering Plan
Files Changed
src/lib/isMobilePhone.js— addedfr-MLandfr-TGentries in alphabetical ordertest/validators.test.js— added valid and invalid test cases for both localesREADME.md— addedfr-MLandfr-TGto the supported locale listCloses #1761