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

Export the locales list for isPostalCode #830

Merged
merged 1 commit into from
May 10, 2018
Merged

Conversation

stevula
Copy link
Contributor

@stevula stevula commented May 10, 2018

Ref #815 (resolves for postal code but not for phone)

Previously, the locales list was not exported at the top level. There was not a reliable way to check programmatically whether a country was supported before validating, which could result in errors.

This removes the need for such workarounds as:
import { locales } from 'validator/lib/isPostalCode';

This now works:
import { isPostalCodeLocales } from 'validator';

I used "isPostalCodeLocales" because an internal reference already existed to that name in the test file.

@chriso
Copy link
Collaborator

chriso commented May 10, 2018

Thanks for the PR 😄

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

Successfully merging this pull request may close these issues.

2 participants