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
import * as v from 'valibot';
const Schema = v.object({
email: v.optional(v.string([v.email()])),
password: v.string([v.minLength(1), v.minLength(8)]),
});
const result = v.safeParse(Schema, {
email: '',
password: '12345678',
});
console.log(result);
Hi,
From the example above, is it possible that if the email is empty do not validate with email() but only when it is not null or not empty string only then validate it?
Thanks
The text was updated successfully, but these errors were encountered:
Hi,
From the example above, is it possible that if the email is empty do not validate with email() but only when it is not null or not empty string only then validate it?
Thanks
The text was updated successfully, but these errors were encountered: