Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. Yup.match = function (key, message, func) {
  2. message = message || 'Values do not match';
  3. func = func || function (value) {
  4. return value === this.options.context[key];
  5. }
  6.  
  7. return Yup.mixed().test('match', message, func);
  8. };
  9.  
  10. var schema = {
  11. email: Yup.string().email(),
  12. confirmEmail: Yup.match('email', 'Emails do not match')
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement