* Add Enrich to frontend * Naive backend implementation * Add work email check * Rename Enrich to Quick Action * Refactor logic to a separate service * Refacto to separate IntelligenceService * Small fixes * Missing Break statement * Address PR comments * Create company interface * Improve edge case handling * Use httpService instead of Axios * Fix server tests
22 lines
352 B
TypeScript
22 lines
352 B
TypeScript
import { emailProvidersSet } from 'src/utils/email-providers';
|
|
|
|
export const isWorkEmail = (email: string) => {
|
|
if (!email) {
|
|
return false;
|
|
}
|
|
|
|
const fields = email.split('@');
|
|
|
|
if (fields.length !== 2) {
|
|
return false;
|
|
}
|
|
|
|
const domain = fields[1];
|
|
|
|
if (!domain) {
|
|
return false;
|
|
}
|
|
|
|
return !emailProvidersSet.has(domain);
|
|
};
|