-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Fix for ticket #2403 "get list of supported countries for passports" #2404
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
@@ -6,8 +6,14 @@ import { locales as isAlphanumericLocales } from '../src/lib/isAlphanumeric'; | |||
import { locales as isMobilePhoneLocales } from '../src/lib/isMobilePhone'; | |||
import { locales as isFloatLocales } from '../src/lib/isFloat'; | |||
import { locales as ibanCountryCodes } from '../src/lib/isIBAN'; | |||
import { locales as isPassportNumberLocales } from '../src/lib/isPassportNumber'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah . I will do the cleanup in another PR shortly
- changed the naming of `isPassportNumberLocales` to be `passportNumberLocales`. See validatorjs#2404 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.