Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
Yup
node v6.17.1
version:
1.0.0
endpoint
share
tweet
const { object, date } = require('yup') const schema = object({ not_required: date().nullable(), required: date().required(), }) let dates = { not_required: '', required: '', } await schema.validate(dates)
Or validate an object you already have:
Or if you want to do both at the same time:
Loading…
no comments
sign in
to comment