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?
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