MCPcopy
hub / github.com/garrytan/gstack / extractDomain

Function extractDomain

browse/src/security.ts:668–674  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

666 * Returns empty string on parse failure rather than throwing.
667 */
668export function extractDomain(url: string): string {
669 try {
670 return new URL(url).hostname;
671 } catch {
672 return '';
673 }
674}

Callers 1

security.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected