The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { type FieldLinksVariant } from '@/types/FieldMetadataSettings';
import { normalizeDomain } from '@/utils/url/normalizeDomain';
import { normalizeUrlOrigin } from '@/utils/url/normalizeUrlOrigin';
export const getLinkUrlNormalizer = (
linksVariant: FieldLinksVariant | undefined,
): ((url: string) => string) =>
linksVariant === 'domain' ? normalizeDomain : normalizeUrlOrigin;