Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Yup.match = function (key, message, func) {
- message = message || 'Values do not match';
- func = func || function (value) {
- return value === this.options.context[key];
- }
- return Yup.mixed().test('match', message, func);
- };
- var schema = {
- email: Yup.string().email(),
- confirmEmail: Yup.match('email', 'Emails do not match')
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement