-
Notifications
You must be signed in to change notification settings - Fork 935
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
string.matches throws error when we pass a string as second parameter #798
Comments
I am also the same issue with
|
Seeing this too |
I faced the same error after I updated yup to |
Same problem for me, rollback in 0.28.1 solve the problem |
I also had this error. The function expects an object, but a string is passed to it and therefore an error message is given. A rollback fixed the issue also for me, but I also made this pull request #801 for a suggested fix. |
Describe the bug
In 0.28.1, these 2 signatures work:
string.matches(regex: Regex, message?: string | function): Schema
string.matches(regex: Regex, options: { message: string, excludeEmptyString: bool }): Schema
In 0.28.2:
The first one throws an error.
Cannot use 'in' operator to search for 'excludeEmptyString' in <message>
The bug has been introduced here: 27e5d68#diff-57c5960218f1091895b3610a7d779378R79
If
options
is a string, we cannot make this operation'excludeEmptyString' in options
.To Reproduce
Expected behavior
Should not throw an error
The text was updated successfully, but these errors were encountered: