validatorjs / validator.js

String validation
MIT License
23.12k stars 2.31k forks source link

isMobilePhone locale should default to 'any' #854

Closed towc closed 6 years ago

towc commented 6 years ago

currently, if you don't pass a second argument, it fails with invalid locale 'undefined', which means you have to look at the docs/source code to figure out what to do, while it's very likely you just want any locale.

setting the default locale to any shouldn't break any code, because if there's no second argument, it just fails.

Agree or disagree?

chriso commented 6 years ago

Agreed. Happy to accept a PR with the change.

towc commented 6 years ago

1 PR and a soda coming up

chriso commented 6 years ago

Fixed by #874. This will go out in the next release.