Skip to content

Add Liberia (en-LR) mobile phone validation - #2967

Open
FullStraing wants to merge 2 commits into
validatorjs:masterfrom
FullStraing:feat/add-liberia-mobile-locale
Open

FullStraing wants to merge 2 commits into
validatorjs:masterfrom
FullStraing:feat/add-liberia-mobile-locale

Conversation

@FullStraing

Copy link
Copy Markdown

Adds the en-LR locale for Liberian mobile numbers (part of #1761).

The pattern accepts the +231 country code (optional +, or trunk 0) and the 9-digit mobile NSN with the allocated prefixes from the Liberia Telecommunications Authority numbering plan: 220 (LIBTELCO), 555 / 880 / 881 / 886 / 887 / 888 (Lonestar Cell MTN), 770 / 772 / 775 / 776 / 777 / 778 / 779 (Orange). Unallocated prefixes such as 882 are rejected.

The supported-locale list in the README and the phone validator tests are updated.

Verification

  • npm test passes: build, lint, and 323 tests, 100% statements/functions/lines.
  • New fixtures cover accepted numbers (with +231, bare country code, trunk 0, and bare NSN) and rejected ones (too short, too long, unallocated 882 prefix).

@codecov

codecov Bot commented Nov 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9ff3424) to head (177934c).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2967   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2599      2599           
  Branches       658       658           
=========================================
  Hits          2599      2599           

☔ View full report in Codecov by Harness.
📢 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