MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / extractHostWithPort

Function extractHostWithPort

packages/backend/src/repoCompileUtils.ts:46–50  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

44 * @returns The host with port if present (e.g., "example.com:443"), or null if not an HTTP(S) URL
45 */
46const extractHostWithPort = (url: string): string | null => {
47 // Match http(s):// URLs: protocol://host(:port)/path
48 const match = url.match(/^https?:\/\/([^/?#]+)/i);
49 return match ? match[1] : null;
50};
51
52type CompileResult = {
53 repoData: RepoData[],

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected