Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ const phones = {
'ar-EH': /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,
'fa-AF': /^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/,
'mk-MK': /^(\+?389|0)?((?:2[2-9]\d{6}|(?:3[1-4]|4[2-8])\d{6}|500\d{5}|5[2-9]\d{6}|7[0-9][2-9]\d{5}|8[1-9]\d{6}|800\d{5}|8009\d{4}))$/,
// Cambodia
'km-KH': /^(\+?855)([1-9]\d{7,8})$/,
};
/* eslint-enable max-len */

Expand Down
22 changes: 22 additions & 0 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6558,6 +6558,28 @@

it('should validate identity cards', () => {
const fixtures = [
{
locale: 'km-KH',
valid: [
'+85512345678',
'+855123456789',
'+85598765432',
'+85519876543',
'85512345678',
'855123456789',
'85598765432',
'85519876543',
],
invalid: [
'+85502345678',
'+8551234567',

Check failure on line 6575 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 22

Trailing spaces not allowed

Check failure on line 6575 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 16

Trailing spaces not allowed

Check failure on line 6575 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 18

Trailing spaces not allowed

Check failure on line 6575 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 8

Trailing spaces not allowed

Check failure on line 6575 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 10

Trailing spaces not allowed

Check failure on line 6575 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 14

Trailing spaces not allowed

Check failure on line 6575 in test/validators.test.js

View workflow job for this annotation

GitHub Actions / Run tests on Node.js 12

Trailing spaces not allowed
'+8551234567890',
'12345678',
'+855abcdefgh',
'',
'+855',
],
},
{
locale: 'PK',
valid: [
Expand Down
Loading