TCMiranda / joi-extract-type

Provides native type extraction from Joi schemas for Typescript
MIT License
151 stars 27 forks source link

Proper Joi.any().required() #34

Closed lonewarrior556 closed 4 years ago

lonewarrior556 commented 4 years ago

Hey, First attempt at a Pr, trying to solve this issue: https://github.com/TCMiranda/joi-extract-type/issues/31

Wasn't sure what the about the tests. I added one to make sure optional and required always matches up with the right type. ( it fails for any, prior to the edits )

ps,

  1. This is extremely useful, would love to help out with the project in anyway.
  2. can we add prettier to make the pr's easier, my editor goes crazy fixing colons and commas
TCMiranda commented 4 years ago

@lonewarrior556 I tried to rebase this to enhancements for typescript 3.9 but something is not working. Check this PR please: https://github.com/lonewarrior556/joi-extract-type/pull/1 It's for your branch.

Please, merge it if you think you can help me make this work with the newer version

TCMiranda commented 4 years ago

I really appreciate your help, unfortunately, I'm not using this library anymore on a daily basis so it is hard for me to keep up with everything.

About this:

can we add prettier to make the PR's easier, my editor goes crazy fixing colons and commas

There is already a prettier config on the root, but I think we are not running it before commits, so that could be an improvement!

TCMiranda commented 4 years ago

@lonewarrior556 I refactored some stuff today and I could integrate your work! We have now anySchema. Check out master branch. Thanks!