Open realtebo opened 2 months ago
Payload: z.object({ PanelOn: z.coerce.boolean(), ]}
having the previous object definition, if we pass a Payload withput the field PanelOn, it will be assumed as boolean false.
How can I force boolean to be first required and then coerced to javascript boolean only if they are present in the object?
I must ensure that validation DO NOT PASSES if field is missing
having the previous object definition, if we pass a Payload withput the field PanelOn, it will be assumed as boolean false.
How can I force boolean to be first required and then coerced to javascript boolean only if they are present in the object?
I must ensure that validation DO NOT PASSES if field is missing