Skip to content

feat(isMobilePhone): add km-KH locale for Cambodia#2680

Open
easedu wants to merge 1 commit intovalidatorjs:masterfrom
easedu:feat/isMobilePhone-km-KH
Open

feat(isMobilePhone): add km-KH locale for Cambodia#2680
easedu wants to merge 1 commit intovalidatorjs:masterfrom
easedu:feat/isMobilePhone-km-KH

Conversation

@easedu
Copy link
Contributor

@easedu easedu commented Mar 7, 2026

Description

Adds mobile phone validation for Cambodia (km-KH) as requested in #2589.

Regex

/^(\+?855|0)(1[0-8]|3[189]|6[0-16-9]|7[016-9]|8[0-13-9]|9[0235-9])\d{6,7}$/

Covers all active Cambodian mobile operator prefixes: Cellcard, Smart, Metfone, Seatel, CooTel, EMAXX, and qb. Supports both 8-digit and 9-digit number formats (Cambodia is transitioning between the two).

Changes

  • src/lib/isMobilePhone.js — Added km-KH regex
  • test/validators.test.js — Added 15 valid and 13 invalid test cases
  • README.md — Added km-KH to supported locales list

References

Checklist

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

Closes #2589

Add mobile phone validation for Cambodia covering all active operator
prefixes (Cellcard, Smart, Metfone, Seatel, CooTel, EMAXX, qb).
Supports both 8-digit and 9-digit formats during transition period.

Closes validatorjs#2589
@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b1aea75) to head (5f2eeaa).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2680   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2595      2595           
  Branches       659       659           
=========================================
  Hits          2595      2595           

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

Add mobile validation for Cambodia

1 participant