MCPcopy Create free account
hub / github.com/AsyncFuncAI/deepwiki-open / extractUrlDomain

Function extractUrlDomain

src/utils/urlDecoder.tsx:1–9  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

1export function extractUrlDomain(input: string): string | null {
2 try {
3 const normalizedInput = input.startsWith('http') ? input : `https://${input}`;
4 const url = new URL(normalizedInput);
5 return `${url.protocol}//${url.hostname}${url.port ? ':' + url.port : ''}`; // Inclut le protocole et le domaine
6 } catch {
7 return null; // Not a valid URL
8 }
9}
10
11export function extractUrlPath(input: string): string | null {
12 try {

Callers 2

parseRepositoryInputFunction · 0.90
RepoWikiPageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected