/** Normalization helpers for lead deduplication. */

export function normalizeEmail(input: string): string {
  return input.toLowerCase().trim();
}

/** Strips all non-digit characters. Returns empty string for invalid input. */
export function normalizePhone(input: string): string {
  return input.replace(/\D/g, "");
}

/** A normalized phone is valid when it has at least 10 digits. */
export function isValidNormalizedPhone(normalized: string): boolean {
  return normalized.length >= 10;
}
