(baseUrl: string)
| 136 | } |
| 137 | |
| 138 | function getDirectoryRootUrl(baseUrl: string): URL | null { |
| 139 | try { |
| 140 | const url = new URL(baseUrl); |
| 141 | url.pathname = ensureTrailingSlash(url.pathname); |
| 142 | url.search = ''; |
| 143 | url.hash = ''; |
| 144 | return url; |
| 145 | } catch { |
| 146 | return null; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | function getRelativeUrlPath(rootUrl: URL, targetUrl: URL): string | null { |
| 151 | if (targetUrl.origin !== rootUrl.origin) { |
no test coverage detected