* 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
228 B
TypeScript
10 lines
228 B
TypeScript
import psl from 'psl';
|
|
|
|
import { capitalize } from 'src/utils/capitalize';
|
|
|
|
export const getCompanyNameFromDomainName = (domainName: string) => {
|
|
const { sld } = psl.parse(domainName);
|
|
|
|
return sld ? capitalize(sld) : '';
|
|
};
|