francescov1 / mongoose-tsgen

A plug-n-play Typescript generator for Mongoose.
102 stars 24 forks source link

Enhance support for Object and Array types #39

Closed kurtcarpenter closed 3 years ago

kurtcarpenter commented 3 years ago

Add support for many other ways of defining Object and Array types, documented here: Array and Object

kurtcarpenter commented 3 years ago

Would appreciate feedback on the _isDefaultSetToUndefined checks as I'm less confident in those changes.

francescov1 commented 3 years ago

Nice stuff, will review later today! Thanks for bearing with some of the weird recursion, I'm looking to simplify it greatly it in the next few weeks.

francescov1 commented 3 years ago

This looks good. I think some of the _isDefaultSetToUndefined logic is overkill (_isDefaultSetToUndefined currently only gets set on subdocument array schemas) but it isnt harming anything so I wouldnt worry about it right now. This file needs a big cleanup as a whole so no use in trying to refactor too much now.