The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
import { getUrlSafely, isDefined } from 'twenty-shared/utils';
export const getUniqueHttpOriginsFromUrls = (
urls: (string | undefined)[],
): string[] => [
...new Set(
urls
.filter(isDefined)
.map((url) => getUrlSafely(url))
.filter(isDefined)
.filter((url) => url.protocol === 'http:' || url.protocol === 'https:')
.map((url) => url.origin),
),
];