Files
twenty_crm/packages/twenty-server/src/modules/messaging/utils/get-domain-name-from-handle.util.ts
Weiko 2c09096edd Refactor backend folder structure (#4505)
* Refactor backend folder structure

Co-authored-by: Charles Bochet <charles@twenty.com>

* fix tests

* fix

* move yoga hooks

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-03-15 18:37:09 +01:00

10 lines
219 B
TypeScript

import psl from 'psl';
export const getDomainNameFromHandle = (handle: string): string => {
const wholeDomain = handle?.split('@')?.[1] || '';
const { domain } = psl.parse(wholeDomain);
return domain || '';
};