Closed cmaster11 closed 4 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 98.48%. Comparing base (
9eb921f
) to head (2cb6f45
). Report is 20 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Ping @mrjono1? :D
Ignore the
{"special": "deep"}
default value introduced by Joi when invoking thedefault()
function without arguments.Ref: https://github.com/hapijs/joi/blob/e7e9c5d18dafaa510a7ece02c225653db5fc998f/lib/manifest.js#L179
Without this fix, the generated TS code would look like:
Note: there is an edge case here where if someone were to use the
{"special":"deep"}
values as default, this would not be printed in the generated type default. I think it's an acceptable "bug" because the Joi library dumps this value in the result of the describe function without providing additional information.Also, fix the generated types in case we have objects with default values, where we then need to use
export type =
instead ofexport interface
because the latter one is invalid with a union.So, instead of the invalid
we get the proper