mrjono1 / joi-to-typescript

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

Use the plain JSON.stringify function to encode default values #389

Closed cmaster11 closed 8 months ago

cmaster11 commented 8 months ago

The previous wrapValue function was incomplete, in the sense that strings with e.g. backslashes would be encoded in the wrong way. In the end, looking at the overall behavior of wrapValue, it seems to want to behave exactly in the same way as JSON.stringify, so it may be worth just replacing it once and for all.

codecov[bot] commented 8 months ago

Codecov Report

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

Comparison is base (43f2159) 98.69% compared to head (b0d0c4e) 98.67%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #389 +/- ## ========================================== - Coverage 98.69% 98.67% -0.03% ========================================== Files 9 9 Lines 537 528 -9 Branches 208 204 -4 ========================================== - Hits 530 521 -9 Misses 7 7 ```

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