joi 17.7
npm i joi
const schema = Joi.object({ a: Joi.string() });
const { error, value } = schema.validate({ a: 'a string' });
官网