MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / extractDomain

Function extractDomain

cli/src/components/choice-ad-banner.tsx:35–42  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

33}
34
35export const extractDomain = (url: string): string => {
36 try {
37 const parsed = new URL(url)
38 return parsed.hostname.replace(/^www\./, '')
39 } catch {
40 return url
41 }
42}
43
44export function getAdDisplayLabel(
45 ad: Pick<AdResponse, 'title' | 'url'>,

Callers 1

getAdDisplayLabelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected