"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.optionalEmailSchema = exports.emailSchema = void 0;
const zod_1 = require("zod");
/**
 * Very basic email validation
 * - Trims any leading or trailing whitespace
 */
exports.emailSchema = zod_1.z
    .string()
    .trim()
    .regex(/^[^\s@]+@[^\s@]+\.[^\s@]+$/, 'Invalid email format');
/**
 * Helper function to create an optional email schema allows undefined and empty strings
 */
exports.optionalEmailSchema = zod_1.z
    .string()
    .optional()
    .refine((val) => val === undefined || val === '' || exports.emailSchema.safeParse(val).success, 'Invalid email format');
//# sourceMappingURL=emailValidation.js.map