MCPcopy Index your code
hub / github.com/simstudioai/sim / normalizeDomain

Function normalizeDomain

apps/sim/enrichments/providers.ts:30–36  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

28
29/** Strips protocol / path / leading `www.` from a domain-ish input. */
30export function normalizeDomain(value: unknown): string {
31 return str(value)
32 .toLowerCase()
33 .replace(/^https?:\/\//, '')
34 .replace(/^www\./, '')
35 .replace(/\/.*$/, '')
36}
37
38/** Returns the first non-empty string in an array (or `undefined`). */
39export function firstNonEmpty(value: unknown): string | undefined {

Callers 4

company-domain.tsFile · 0.90
work-email.tsFile · 0.90
phone-number.tsFile · 0.90
company-info.tsFile · 0.90

Calls 2

strFunction · 0.85
replaceMethod · 0.65

Tested by

no test coverage detected