SHARE
TWEET

Untitled

a guest May 23rd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top