This Zod validation fails when the provided value is a "undefined"
string.
const schema = z.string().time().optional()
This leads to undesired behaviour, as the form is invalidated. My guess is the time method return false, because "undefined"
is not coerced to its primitive type.
What’s the simplest way to handle this edge case using Zod?