Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

yup-validate-object

node v10.24.1
version: 2.0.0
endpointsharetweet
const yup = require("yup") var login_schema =yup.object().shape( { name: yup.string().required('name is required').email(), pwd: yup.string().required('pass is required') }) let name_and_pass = { name: '', pwd: '' } try { login_schema.validateSync(name_and_pass); } catch (e ){ console.log(e.errors); }
Loading…

no comments

    sign in to comment