const Joi = require('@hapi/joi');
Joi.object({
password: Joi
.string()
.custom((value, helper) => {
if (value.length < 8) {
return helper.message("Password must be at least 8 characters long");
}
return true;
})
}).validate({
password: '1234'
});