JacobWeisenburger / zod_utilz

Framework agnostic utilities for Zod
MIT License
158 stars 9 forks source link

z.infer should be z.input #13

Closed scamden closed 3 months ago

scamden commented 3 months ago

https://github.com/JacobWeisenburger/zod_utilz/blob/2615a26eececeea1134ef53a581e00fb363bf3a4/src/useTypedParsers.ts#L28

if i pass

z
.number()
.int()
.min(1)
.default(DEFAULT_CONCURRENCY)

to useTypedParsers right now the resulting .parse won't accept undefined but I believe it should!

using z.input<Schema> solves this for me, just thought I'd open this as a possible improvement. Thanks for this really helpful library!

JacobWeisenburger commented 3 months ago

good catch. I'll get that fixed asap

JacobWeisenburger commented 3 months ago

Should be fixed in https://github.com/JacobWeisenburger/zod_utilz/releases/tag/0.8.3. Let me know if it works for you?

scamden commented 3 months ago

looks great! thanks for the quick turnaround!

JacobWeisenburger commented 3 months ago

Thanks for clearly describing your issue. lol. It is crazy how many people struggle with making a simple explanation. :D