-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Labels
Description
Is it possible to use the Joi "when" operator? In Joi, one can do:
Joi .string() .valid.apply(this, days) .required() .when("action", { is: "DELETE", then: Joi.string().optional(), otherwise: Joi.string().required() })
However, with jf,
@(jf .string() .valid.apply(this, days) .required() .when("action", { is: "DELETE", then: jf.string().optional(), otherwise: jf.string().required() }))
I receive an error:
TypeError: jf.string(...).valid.apply(...).required(...).when is not a function