Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get list of supported countries for passports #2403

Closed
derekparnell opened this issue May 21, 2024 · 2 comments
Closed

get list of supported countries for passports #2403

derekparnell opened this issue May 21, 2024 · 2 comments

Comments

@derekparnell
Copy link
Contributor

I am having a similar issue to that of #815, but for passports.

Specifically, I would like to validate passport numbers for all known countries, but for unknown countries I would like to provide my own, simple validation. However, the list of known countries is not programmatically available, so unknown countries are just considered invalid.

As an example, Albania is unknown and so the code simply returns that it is false.

derekparnell pushed a commit to derekparnell/validator.js that referenced this issue May 21, 2024
- get list of supported countries for passports

The list of supported countries was not exported, so it was impossible to know which countries were available from code.

Added a simple export of the countries as locale, similar to how it is done in `isPostalCode.js`.
@derekparnell
Copy link
Contributor Author

I created a fix and a corresponding Pull request

@rubiin rubiin added pr-raised and removed 🐛 bug labels May 29, 2024
derekparnell pushed a commit to derekparnell/validator.js that referenced this issue Jun 13, 2024
- changed the naming of `isPassportNumberLocales` to be `passportNumberLocales`.

See validatorjs#2404 (comment)
profnandaa pushed a commit that referenced this issue Jun 22, 2024
@profnandaa
Copy link
Member

closed in #2404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants