You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the best way to validate optional ISO time?
When I write schema like this in the Playground:
import*asvfrom'valibot'constSchema=v.pipe(v.string(),v.union([v.literal(''),v.isoTime('Invalid time format')]))constresult=v.safeParse(Schema,'08:34')console.log('result',result)
I receive cryptic errors.
When I copy this code into my editor, I receive cryptic TS errors related to union.
The text was updated successfully, but these errors were encountered:
import*asvfrom'valibot';// Time or undefinedconstSchema1=v.optional(v.pipe(v.string(),v.isoTime()));// Time or empty stringconstSchema2=v.union([v.literal(''),v.pipe(v.string(),v.isoTime())]);
What is the best way to validate optional ISO time?
When I write schema like this in the Playground:
I receive cryptic errors.
When I copy this code into my editor, I receive cryptic TS errors related to
union
.The text was updated successfully, but these errors were encountered: