I'd like to strip/remove fields not defined in the schema - is this possible w/ yup at all?
schema.cast(value, { stripUnknown: true})
const contactSchema = yup.object({
name: yup.string()
.required(),
})
const v = contactSchema.noUnknown().cast({
name: 'cory',
age: 33
})
Most helpful comment
const contactSchema = yup.object({
name: yup.string()
.required(),
})
const v = contactSchema.noUnknown().cast({
name: 'cory',
age: 33
})