Closed thomasmikava closed 5 years ago
Consider the following schema:
const schema = Joi.alternatives([ Joi.number(), Joi.array().items(Joi.number()), ]);
This produces a correct type number | number[]
number | number[]
However, if I add allow(null),
const schema = Joi.alternatives([ Joi.number(), Joi.array().items(Joi.number()), ]).allow(null);
then the produced type is only number[], while it has to be number | number[] | null
number[]
number | number[] | null
Fixed in 2.0.6
Consider the following schema:
This produces a correct type
number | number[]
However, if I add allow(null),
then the produced type is only
number[]
, while it has to benumber | number[] | null