Skip to content

Conversation

@manuelaidos123
Copy link

Add validation for Haiti National Identity Card (CIN) and mobile phone numbers.

  • isIdentityCard: validates CIN format (1 letter followed by 10 digits).
  • isMobilePhone: validates Haiti mobile phone format.

Description

Added validation support for Haiti National Identity Card (CIN) and Haiti mobile phone numbers.

Changes Made

isIdentityCard.js:

  • Added 'ht-HT' locale validator for Haiti National Identity Card (Carte d'Identité Nationale)
  • Format: 1 letter followed by 10 digits (11 characters total)
  • Regex: /^[A-Za-z]\d{10}$/

isMobilePhone.js:

  • Added 'ht-HT' locale validator for Haiti mobile phone numbers
  • Format: Optional +509 country code followed by 8 digits starting with 2-4
  • Regex: /^(\+?509)?[2-4]\d{7}$/

References

  • Haiti CIN format: Single letter prefix + 10 digits (e.g., A1234567890)
  • Haiti mobile prefixes: 2xxx, 3xxx, 4xxx (8 digits total)
  • Country code: +509

Test Results

Haiti Identity Card Tests:
A1234567890: true
B9876543210: true
Invalid (too short): false

Haiti Mobile Phone Tests:
+50923456789: true
23456789: true
31234567: true
41234567: true
Invalid (starts with 5): false

Add validation for Haiti National Identity Card (CIN) and mobile phone numbers.
- `isIdentityCard`: validates CIN format (1 letter followed by 10 digits).
- `isMobilePhone`: validates Haiti mobile phone format.
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