Skip to content

The open alternative to Salesforce, designed for AI.

219 B
Raw Blame
export const getDomainFromEmail = (email: string): string | undefined => {
  const lastAtIndex = email.lastIndexOf('@');

  if (lastAtIndex === -1) {
    return undefined;
  }

  return email.slice(lastAtIndex + 1);
};