($url: string)
| 71 | } |
| 72 | |
| 73 | export function getURLHostOrProtocol($url: string): string { |
| 74 | const url = new URL($url); |
| 75 | if (url.host) { |
| 76 | return url.host; |
| 77 | } else if (url.protocol === 'file:') { |
| 78 | return url.pathname; |
| 79 | } |
| 80 | return url.protocol; |
| 81 | } |
| 82 | |
| 83 | export function compareURLPatterns(a: string, b: string): number { |
| 84 | return a.localeCompare(b); |
no outgoing calls
no test coverage detected