Arrays lose all type information if they are allowed to be null
Opened this issue · 1 comments
lonewarrior556 commented
simple example
import Joi from '@hapi/joi';
import 'joi-extract-type';
var schema = Joi.object({
one: Joi.array().items({ a: Joi.string().required() }),
two: Joi.array().items({ a: Joi.string().required() }).allow(null),
});
type Extracted = Joi.extractType<typeof schema>;
packages
"@hapi/joi": "15.1.1",
"joi-extract-type": "15.0.8",
"@types/hapi__joi": "15.0.4",
i-kay commented