Fix for ticket #2403 "get list of supported countries for passports"#2404
Fix for ticket #2403 "get list of supported countries for passports"#2404profnandaa merged 2 commits intovalidatorjs:masterfrom
Conversation
- 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`.
|
Now that it's been approved by 2 people, shouldn't the block be gone? Because it still says that at least 2 approving reviews are required. Unless the approvers were not reviewers with write access. |
test/exports.test.js
Outdated
There was a problem hiding this comment.
The idea is good. Perhaps just for better clarity, dropping the is is better? Since is denotes doing a check which should be a function, but this is a list. So just passportNumberLocales is good with me.
There was a problem hiding this comment.
I can do that, but it won't be following the same naming convention as the rest of the imports in the exports.test.js (barring the ibanCountryCodes outlier). I went with consistency in naming.
Please let me know if I should change it or leave it as-is.
There was a problem hiding this comment.
@derekparnell do change . I think we need to drop the is prefix on others as well . Doesnt make sense
There was a problem hiding this comment.
ok. I made the change from isPassportNumberLocales to passportNumberLocales. I did not change the others, as I understand that would be in another issue ticket, since it's unrelated to this issue (although the theme is similar).
There was a problem hiding this comment.
yeah . I will do the cleanup in another PR shortly
- changed the naming of `isPassportNumberLocales` to be `passportNumberLocales`. See validatorjs#2404 (comment)
profnandaa
left a comment
There was a problem hiding this comment.
Thanks for your contrib! 🎉
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.