(repository: string)
| 29 | } |
| 30 | |
| 31 | export function repositoryLabel(repository: string) { |
| 32 | const url = new URL(repository) |
| 33 | const path = url.pathname.replace(/^\/|\/$/g, '') |
| 34 | return `${url.hostname.replace(/^www\./, '')}/${path}` |
| 35 | } |
| 36 | |
| 37 | export function withBasePath(path: string) { |
| 38 | if (/^https?:\/\//.test(path)) return path |
nothing calls this directly
no outgoing calls
no test coverage detected