jmcdo29 / nest-lab

A repository to hold "experimental" packages for Nest. Honestly, I'm just tired of not having a good scope to put packages under :smile_cat:
87 stars 7 forks source link

Question: Using typeschema with nestjs/config #31

Closed rubiin closed 1 year ago

rubiin commented 1 year ago

Been using @nest-lab/typeschema and it is super awesome as I could switch the underlying validator. I was wondering is there a way to make it work with nestjs/config as well.

jmcdo29 commented 1 year ago

As all that matters is that there's a validate function that gets passed to ConfigModule.forRoot() that takes in a config record and passed back the validated config or throws an exception, you could use @decs/typeschema directly and use whatever schema library you prefer