validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

feat(isIdentityCard): add NL locale

Open RobinvanderVliet opened this issue 2 years ago • 2 comments

I have added a Dutch validation method to isIdentityCard.

References

  • https://nl.wikipedia.org/wiki/Burgerservicenummer
  • https://www.rijksoverheid.nl/onderwerpen/privacy-en-persoonsgegevens/vraag-en-antwoord/wat-is-het-burgerservicenummer-bsn

Checklist

  • [x] PR contains only changes related; no stray files, etc.
  • [x] README updated (where applicable)
  • [x] Tests written (where applicable)
  • [x] References provided in PR (where applicable)

RobinvanderVliet avatar Nov 12 '23 16:11 RobinvanderVliet

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.95%. Comparing base (b958bd7) to head (9d04193). Report is 22 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2338   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files         107      107           
  Lines        2454     2458    +4     
  Branches      619      621    +2     
=======================================
+ Hits         2453     2457    +4     
  Partials        1        1           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 12 '23 16:11 codecov[bot]

Not sure about this one, the BSN is comparable to the American Social Security Number, but it's not the document number of Dutch identity cards. We might need to do further review on what the isIdentityCard really validates and possibly change the name so it is clear. In my view right now we should have three validators; isIdentityCard, isPassportNumber and a third that checks for cases like the BSN and the SSN

I have checked some of the already implemented validator functions in the file, and the validator functions for Finland, Israel, Norway and Spain all seem to check national ID numbers. There might be others that are similar, I have not had time to check them all.

Similar to Dutch cards, Norwegian ID cards have the document number on the front side and the national ID number on the reverse side. The Norwegian validator checks the national ID number.

RobinvanderVliet avatar Nov 12 '23 18:11 RobinvanderVliet