Skip to content

feat(isMobilePhone): add phone number validation for Côte d'Ivoire (fr-CI)#2577

Open
DipandaAser wants to merge 2 commits intovalidatorjs:masterfrom
DipandaAser:master
Open

feat(isMobilePhone): add phone number validation for Côte d'Ivoire (fr-CI)#2577
DipandaAser wants to merge 2 commits intovalidatorjs:masterfrom
DipandaAser:master

Conversation

@DipandaAser
Copy link
Copy Markdown

@DipandaAser DipandaAser commented Jul 20, 2025

Description

This PR adds mobile phone number validation support for Côte d'Ivoire using the locale code fr-CI to the isMobilePhone validator.

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

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (72573b3) to head (81853d3).
⚠️ Report is 29 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rubiin rubiin requested review from WikiRik and Copilot and removed request for Copilot April 2, 2026 08:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-CI locale regex to src/lib/isMobilePhone.js.
  • Added fr-CI valid/invalid fixture cases to test/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.

Comment on lines 101 to 105
'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}$/,
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants