joi OR ИЛИ Строка или пользовательский тип
Primary tabs
Используйте joi.alternatives().try()
Например:
joi.alternatives().try( joi.string().allow(null, ''), // или строка (пустая или нал допустима) joi.object({ // или объект с двумя полями start: joi.string().allow(null, ''), end: joi.string().allow(null, ''), }), ),
Продробнее:
- Log in to post comments
- 1054 reads