News for hackers. Stuff that matters.
Re:TypeScript please give us types by kristiandupont on Saturday July 08, 2023 @06:35AM (#36643115)
That's a good point.

I just realized that I am working around this problem by explicitly setting a `z.Schema<...>` type: https://github.com/kristiandupont/kanel/blob/main/example/mo...

But I agree with you that there is room for improvement.

Re:TypeScript please give us types by lf-non on Saturday July 08, 2023 @07:14AM (#36643327)
Ah ok. However, typescript is mostly smart enough to propagate comments [1] from zod schema properties to inferred types on its own.

Thanks for maintaining kanel btw. We used to use this in a previous role alongside knex. It was very useful.

[1] https://lorefnon.me/2022/06/25/generating-api-docs-for-zod-t...

Re:TypeScript please give us types by kristiandupont on Saturday July 08, 2023 @07:19AM (#36643357)
Hah, I wasn't aware! I think that must have been fixed after I tried it the first time because I definitely concluded that it was necessary back then. And thank you for the kind words!