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
Locale Validation not correct? #821
Comments
The phone number is supposed to be valid for the specified country. |
Thanks for the reply, although that doesn't answer my question? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First of all thanks for creating this!
I guess this is more of a question than an issue, although the answer will indicate whether it's a bug or not.
My understanding would be if you tried to validate a number with a specific locale using a different country code, that it would return
false
.e.g. given
const phoneSchemaDE = yup.string().phone('DE');
I would expect the following to return
false
, as the country code is notDE
:phoneSchemaDE.isValidSync('+919876543210');
but it doesn't, it returns
true
.So my ultimate quesiton is,
is the locale check:
"is this number a valid phone number when calling FROM this country?"
or
"is this number a valid number FOR this country?"
The text was updated successfully, but these errors were encountered: