I need to validate one field of object when two fields of same object is true. I have an object like
person={
is_active: // either true or false
is_valid: // either true or false
username :'' // validation required field
}
so i have to do validation like
if (is_active==true && is_valid==true)
then only i have to validate username like
Joi.string().required()
I have tried the nested when condition but it throws Assertion Error
如此处对用户名所述,使用is
子句
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.