Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

1.3 KB
Raw Blame
// Mirrors PERSONAL_EMAIL_DOMAINS in the API's lib/personal-email-domains.ts, which rejects these
// as domain allowlists; an entry missing here offers an organization option the server refuses.
const PERSONAL_EMAIL_DOMAINS = new Set<string>([
  'gmail.com',
  'googlemail.com',
  'outlook.com',
  'hotmail.com',
  'live.com',
  'msn.com',
  'yahoo.com',
  'yahoo.co.uk',
  'ymail.com',
  'rocketmail.com',
  'icloud.com',
  'me.com',
  'mac.com',
  'privaterelay.appleid.com',
  'private.icloud.com',
  'proton.me',
  'protonmail.com',
  'pm.me',
  'aol.com',
  'fastmail.com',
  'fastmail.fm',
  'tutanota.com',
  'tuta.io',
  'gmx.com',
  'gmx.de',
  'gmx.net',
  'mail.com',
  'zoho.com',
  'yandex.com',
  'yandex.ru',
  'duck.com',
  'hey.com',
  'qq.com',
  '163.com',
  '126.com',
  'sina.com',
]);

export function emailDomain(email: string): string {
  if (typeof email !== 'string') return '';
  const trimmed = email.trim();
  const angle = /<([^<>]+)>/.exec(trimmed);
  const address = (angle ? angle[1] : trimmed).trim();
  const at = address.lastIndexOf('@');
  if (at === -1) return '';
  return address
    .slice(at + 1)
    .trim()
    .toLowerCase();
}

export function isPersonalEmailDomain(domain: string): boolean {
  if (typeof domain !== 'string') return false;
  return PERSONAL_EMAIL_DOMAINS.has(domain.toLowerCase());
}