GoogleFeud / ts-runtime-checks

A typescript transformer that automatically generates validation code from your types.
https://googlefeud.github.io/ts-runtime-checks/
MIT License
296 stars 6 forks source link

Make by default all type asserted to avoid passing Assert<> everywhere #61

Open acemtp opened 1 month ago

acemtp commented 1 month ago

We really love what you've done.

We try to pimp a lot MeteorJS using full TS and use your package to runtime check all the part that come from the client that cannot be trusted.

But in the end, we love to keep the code simple and small and we would like to be able to check everything every time and only disable it with NoAssert<> or something like that in the very rare case we need optimisation.

The other benefit is that dev cannot forget to add Assert because we prefer checking too much things than forgetting to check onething that can become a hack.

function validate(user: User)

will add the assert for User.

GoogleFeud commented 1 month ago

Hi! I think this is a great idea, I'll implement it in the next version!