Files
HiveGrid-Wireframes/hivegrid-cloud/apps/web/app/utils/helpers/EmailHelper.ts
T

10 lines
311 B
TypeScript

/**
* Return the company name based on the email domain:
* person@company.com -> company, person@dev.company.com -> company
*/
export const companyFromEmail = (email: string) => {
const domain = email.split("@")[1];
const domainParts = domain.split(".");
return domainParts[domainParts.length - 2];
};