I am extracting type from Joi schema using joi-extract-type. It has no compile time issue with @hapi/joi but when upgraded Joi to latest version of now (17.2.1). It does not understand extractType.
What could be simplest solution to get it fixed until it's typing is fixed at source?
One solution could be, providing this typing locally. Could anybody provide declaration for this or any other better solution?
export type dto = Joi.extractType<typeof schema>;
"joi": "^17.2.1",
"joi-extract-type": "^15.0.8",
In express-joi-validation documantation you will find this note above 'joi-extract-type' exemple. NOTE: this does not work with Joi v16+ at the moment. Link for the issue.
If you want to use 'joi-extract-type' you must downgrade 'joi' below v16.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With