Zod doesn't (yet[0]) and it's been a pain point for me.
[0] https://github.com/colinhacks/zod/issues/635
import * as v from 'valibot'; const OptionalKeySchema = v.object({ key: v.optional(v.string()) }); type t1 = v.InferInput<typeof OptionalKeySchema>; // { key?: string } const UndefinedKeySchema = v.object({ key: v.undefinedable(v.string()) }); type t2 = v.InferInput<typeof UndefinedKeySchema>; // { key: undefined }
[1]: https://github.com/sinclairzx81/typebox
Zod doesn't (yet[0]) and it's been a pain point for me.
[0] https://github.com/colinhacks/zod/issues/635