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

Added option to validate any phone locale #663

Merged
merged 5 commits into from
Jun 22, 2017

Conversation

RichieRock
Copy link
Contributor

This PR will add locale option 'any'. It will pass if any of the given mobile phone locales are valid. I find it very useful in situations where users can insert just a phone number regardless of locale.

@chriso
Copy link
Collaborator

chriso commented Jun 22, 2017

Could you add a test case and also make a note in the README? Thanks.

@validatorjs validatorjs deleted a comment from coveralls Jun 22, 2017
@validatorjs validatorjs deleted a comment from coveralls Jun 22, 2017
@RichieRock
Copy link
Contributor Author

@chriso I have added tests for 'any' locale. There is also a note in README. For maintainability, I moved all valid/invalid phonenumbers in the tests into their own variables and use them when testing 'any' argument.

@chriso
Copy link
Collaborator

chriso commented Jun 22, 2017

Perfect. Thanks!

@chriso chriso merged commit 9d85f72 into validatorjs:master Jun 22, 2017
@RichieRock
Copy link
Contributor Author

Thanks! When will you do a new minor release which would include this?

@chriso
Copy link
Collaborator

chriso commented Jun 22, 2017

Probably not for a little while since I just tagged 7.1.0.

builtinnya added a commit to builtinnya/DefinitelyTyped that referenced this pull request Feb 20, 2018
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