Farhan Yaseen Farhan Yaseen - 1 year ago 152
Node.js Question

How boolean can accept empty string

I have scenario i want

to accept
and empty string

how can i do this

var Register = Joi.object().keys({
company_id: Joi.string().required(),
subscribe: Joi.boolean()

Answer Source
subscribe: [Joi.boolean, Joi.string.max(0)]

Took me 3sec of reading the examples on the github documentation.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download