* 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>
10 lines
219 B
TypeScript
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 || '';
|
|
};
|