(path: string)
| 19 | } |
| 20 | |
| 21 | export function apiUrl(path: string): string { |
| 22 | const root = apiRoot(); |
| 23 | if (!root) { |
| 24 | return path; |
| 25 | } |
| 26 | return `${root}${path.startsWith("/") ? path : `/${path}`}`; |
| 27 | } |
| 28 | |
| 29 | function normalizeRoot(root: string): string { |
| 30 | return root.replace(/\/+$/, ""); |
no test coverage detected