mrjono1 / joi-to-typescript

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

Adds the `tsContentHeader` and `tsContentFooter` settings #398

Closed cmaster11 closed 8 months ago

cmaster11 commented 8 months ago

Adds the tsContentHeader and tsContentFooter settings.

They let you prepend/append some code to every generated interface. This can be useful when you generate documentation automatically and you want to import full code blocks in your docs by defining begin/end markers of the various blocks.

E.g.

tsContentHeader: type => `// [block "${type.interfaceOrTypeName}" begin]`,
tsContentFooter: type => `// [block "${type.interfaceOrTypeName}" end]`
// [block "Other" begin]
export interface Other {
  other?: string;
}
// [block "Other" end]
codecov[bot] commented 8 months ago

Codecov Report

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

Comparison is base (8b4fb10) 98.67% compared to head (fa34f6a) 98.68%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #398 +/- ## ======================================= Coverage 98.67% 98.68% ======================================= Files 9 9 Lines 528 532 +4 Branches 204 206 +2 ======================================= + Hits 521 525 +4 Misses 7 7 ```

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