Skip to content

The open alternative to Salesforce, designed for AI.

363 B
Raw Blame
import { z } from 'zod';

import { isDomain } from 'src/engine/utils/is-domain';

export const BLOCKLIST_HANDLE_SCHEMA = z
  .string()
  .trim()
  .pipe(z.email({ error: 'Invalid email or domain' }))
  .or(
    z
      .string()
      .refine(
        (value) => value.startsWith('@') && isDomain(value.slice(1)),
        'Invalid email or domain',
      ),
  );