const { object, number } = require('yup')
const contactSchema = object({
age: number()
.integer()
})
// this should be valid. note: it's a string
contactSchema.validate({
age: '24'
}, { strict: true })
.then(valid => console.log('valid', valid))
.catch(e => console.log(e))
// this should be invalid
contactSchema.validate({
age: '24,6'
}, { strict: true })
.then(valid => console.log('valid', valid))
.catch(e => console.log(e))