mrjono1 / joi-to-typescript

Convert Joi Schemas to TypeScript interfaces
MIT License
124 stars 39 forks source link

Support raw empty objects #409

Closed cmaster11 closed 7 months ago

cmaster11 commented 7 months ago

There is a peculiar Joi detail where Joi.object() and Joi.object({}) behave in different ways:

When generating TS definitions, Joi.object() is perfectly represented by object, but Joi.object({}) should be a forcefully empty object {}.

This PR addresses this last situation.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (12420fe) 98.77% compared to head (7501e89) 98.79%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #409 +/- ## ========================================== + Coverage 98.77% 98.79% +0.01% ========================================== Files 9 9 Lines 573 580 +7 Branches 218 224 +6 ========================================== + Hits 566 573 +7 Misses 7 7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.