Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(isMobilePhone): add support for Gibraltar (en-GI) locale#2670

Open
abhu85 wants to merge 1 commit intovalidatorjs:masterfrom
abhu85:rescue/gibraltar-phone-2520
Open

feat(isMobilePhone): add support for Gibraltar (en-GI) locale#2670
abhu85 wants to merge 1 commit intovalidatorjs:masterfrom
abhu85:rescue/gibraltar-phone-2520

Conversation

@abhu85
Copy link

@abhu85 abhu85 commented Mar 2, 2026

Summary

Add mobile phone validation support for Gibraltar (en-GI locale).

Changes

  • Add en-GI regex pattern to isMobilePhone.js supporting:
    • Mobile series 54-59 (8 digits)
    • Mobile series 510, 522 (8 digits)
    • Mobile series 5250-5251 (8 digits)
    • Mobile series 6010-6011 (8 digits)
  • Add comprehensive test cases (48 valid + 15 invalid numbers)
  • Update README.md to include en-GI in locale list

Background

This PR rescues the stale PR #2520 by @xKarinSan which had merge conflicts preventing merge. The original implementation has been rebased onto current master with the following fixes:

  • Added missing $ anchor at end of regex to prevent partial matches

Test Plan

  • All 317 existing tests pass
  • 100% code coverage maintained
  • Linting passes
  • New locale tested with valid and invalid number formats

References


Co-Authored-By: xKarinSan [email protected]

Add mobile phone validation for Gibraltar with support for:
- Mobile series 54-59 (8 digits)
- Mobile series 510, 522 (8 digits)
- Mobile series 5250-5251 (8 digits)
- Mobile series 6010-6011 (8 digits)

Based on Gibraltar's official numbering plan.

Rescues stale PR validatorjs#2520 by rebasing changes onto current master.

Original author: @xKarinSan

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: xKarinSan <[email protected]>
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (f39bb3b) to head (6f879f1).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2670   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2592      2592           
  Branches       660       660           
=========================================
  Hits          2592      2592           

☔ 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.

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.

1 participant