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

Fix for ticket #2403 "get list of supported countries for passports" #2404

Merged
merged 2 commits into from
Jun 22, 2024

Conversation

derekparnell
Copy link
Contributor

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.

- 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`.
WikiRik
WikiRik previously approved these changes May 26, 2024
rubiin
rubiin previously approved these changes May 29, 2024
@derekparnell
Copy link
Contributor Author

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.

@@ -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';
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

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).

Copy link
Member

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)
@derekparnell derekparnell dismissed stale reviews from rubiin and WikiRik via cadec20 June 13, 2024 08:10
Copy link
Member

@profnandaa profnandaa left a 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! 🎉

@profnandaa profnandaa merged commit f73e3f2 into validatorjs:master Jun 22, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants