Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

325 B
Raw Blame
export const externalLinkHref = (href: string | null | undefined): string | null => {
  if (!href || !/^https?:\/\//i.test(href)) return null;
  return href;
};

export const truncateUrl = (url: string, max = 100): string => {
  if (url.length <= max) return url;
  return `${url.slice(0, max - 31)}…${url.slice(-30)}`;
};