Skip to content
Open
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
9 changes: 9 additions & 0 deletions src/lib/isIdentityCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,15 @@ const validators = {

return DNI.test(sanitized);
},
'ht-HT': (str) => {
// Haiti National Identity Card (CIN - Carte d'Identité Nationale)
// Format: 1 letter followed by 10 digits (11 characters total)
const CIN = /^[A-Z]\d{10}$/;

const sanitized = str.trim().toUpperCase();

return CIN.test(sanitized);
},
'zh-CN': (str) => {
const provincesAndCities = [
'11', // 北京
Expand Down
1 change: 1 addition & 0 deletions src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ const phones = {
'fr-RE': /^(\+?262|0|00262)[67]\d{8}$/,
'fr-WF': /^(\+681)?\d{6}$/,
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
'ht-HT': /^(\+?509)?[2-4]\d{7}$/,
'hu-HU': /^(\+?36|06)(20|30|31|50|70)\d{7}$/,
'id-ID': /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,
'ir-IR': /^(\+98|0)?9\d{9}$/,
Expand Down
34 changes: 34 additions & 0 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6980,6 +6980,22 @@ describe('Validators', () => {
'12345678!',
],
},
{
locale: 'ht-HT',
valid: [
'A1234567890',
'B9876543210',
'Z0000000000',
'a1234567890',
],
invalid: [
'12345678901',
'AB123456789',
'A123456789',
'A12345678901',
'A123456789!',
],
},
{
locale: 'zh-CN',
valid: [
Expand Down Expand Up @@ -8078,6 +8094,24 @@ describe('Validators', () => {
'064349089895623459',
],
},
{
locale: 'ht-HT',
valid: [
'+50923456789',
'+50931234567',
'+50941234567',
'23456789',
'31234567',
'41234567',
],
invalid: [
'+50951234567',
'+50901234567',
'12345678',
'5091234567',
'123456',
],
},
{
locale: 'hu-HU',
valid: [
Expand Down
Loading