Skip to content

The open alternative to Salesforce, designed for AI.

447 B
Raw Blame
export const sanitizeURL = (link: string | null | undefined) => {
  return link
    ? link
        .replace(/(^https?:\/\/)/i, '')
        .replace(/(^www\.)/i, '')
        .replace(/\/$/, '')
    : '';
};

export const getLogoUrlFromDomainName = (
  domainName?: string,
): string | undefined => {
  const sanitizedDomain = sanitizeURL(domainName);
  return sanitizedDomain
    ? `https://twenty-icons.com/${sanitizedDomain}`
    : undefined;
};