feat(isMobilePhone): add phone number validation for Côte d'Ivoire (fr-CI)#2577
feat(isMobilePhone): add phone number validation for Côte d'Ivoire (fr-CI)#2577DipandaAser wants to merge 2 commits intovalidatorjs:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2577 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2535 2535
Branches 641 641
=========================================
Hits 2535 2535 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds Côte d'Ivoire (fr-CI) support to the isMobilePhone validator by introducing a new locale regex and corresponding test fixtures, extending the set of supported mobile phone locales.
Changes:
- Added
fr-CIlocale regex tosrc/lib/isMobilePhone.js. - Added
fr-CIvalid/invalid fixture cases totest/validators.test.js.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/lib/isMobilePhone.js |
Adds the fr-CI locale pattern to the phones locale-to-regex map. |
test/validators.test.js |
Adds fr-CI fixture coverage for accepted and rejected mobile formats. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 'fr-BF': /^(\+226|0)[67]\d{7}$/, | ||
| 'fr-BJ': /^(\+229)\d{8}$/, | ||
| 'fr-CD': /^(\+?243|0)?(8|9)\d{8}$/, | ||
| 'fr-CI': /^(\+?225)?(01|05|07)[0-9]{8}$/, | ||
| 'fr-CM': /^(\+?237)6[0-9]{8}$/, |
There was a problem hiding this comment.
fr-CI is added to the phones map, but the README’s isMobilePhone locale list is now out of date (it currently enumerates supported locales and does not include fr-CI). Please add fr-CI to that documented locale list to keep public docs in sync with validator.isMobilePhoneLocales.
Description
This PR adds mobile phone number validation support for Côte d'Ivoire using the locale code
fr-CIto theisMobilePhonevalidator.References
Orange Telecoms CI: https://www.orange.ci/fr/plan-national-de-numerotation-a-10-chiffres.html
The article is in french but you can translate it in English
Checklist