From 4107150307d1c5537a1390d876d259dff9c877ca Mon Sep 17 00:00:00 2001 From: 2005LIKHITH Date: Wed, 3 Jun 2026 21:02:32 +0530 Subject: [PATCH] feat(isMobilePhone): add km-KH (Cambodia) mobile phone validation --- src/lib/isMobilePhone.js | 1 + test/validators.test.js | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index 32379bde5..9dfacecbf 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -120,6 +120,7 @@ const phones = { 'ka-GE': /^(\+?995)?(79\d{7}|5\d{8})$/, 'kk-KZ': /^(\+?7|8)?7\d{9}$/, 'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/, + 'km-KH': /^(\+?855|0)(1[0-9]|6[0-9]|7[0-9]|8[0-9]|9[0-9])\d{6,7}$/, 'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/, 'ky-KG': /^(\+996\s?)?(22[0-9]|50[0-9]|55[0-9]|70[0-9]|75[0-9]|77[0-9]|880|990|995|996|997|998)\s?\d{3}\s?\d{3}$/, 'lt-LT': /^(\+370|8)\d{8}$/, diff --git a/test/validators.test.js b/test/validators.test.js index a4c3d7193..c33699a60 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -9953,6 +9953,26 @@ describe('Validators', () => { '77600000x', ], }, + { + locale: 'km-KH', + valid: [ + '+85592662075', + '+855972345678', + '0882345678', + '010234567', + '+85510234567', + '85592662075', + ], + invalid: [ + '+85512345', + '+85555123456', + '+254728530234', + 'abcdefghijk', + '+855abc12345', + '8551234567890', + '', + ], + }, { locale: 'ko-KR', valid: [