feat: add fr-FR license plate validator#2806
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2806 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2587 2588 +1
Branches 656 656
=========================================
+ Hits 2587 2588 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tux-tn
left a comment
There was a problem hiding this comment.
Thank you for your PR
The official ANTS documentation (https://immatriculation.ants.gouv.fr/tout-savoir/numero-logo-et-plaque) (In french) states that the SIV format excludes I, O, and U, and also prohibits the two-letter combination SS:
Une seule association de deux lettres est interdite, SS…
The current regex excludes I/O/U but accepts SS, for example SS-123-AA and AA-123-SS. Could you update the validator and add regression tests covering SS in both letter-pair positions?
short description of the changes for this issue:
isLicensePlate: Added support for France (fr-FR), validating French SIV license plates (2 letters, 3 digits, 2 letters, excluding the characters I, O, and U to avoid optical confusion).
Documentation & Tests: Updated README.md to list fr-FR as a supported locale, and added unit tests in test/validators.test.js covering valid (e.g., AB-123-CD, AB123CD) and invalid (e.g., AI-123-BB, ab-123-cd) formats.