(url, specUrl, { selectedServer="" } = {})
| 16 | } |
| 17 | |
| 18 | export function buildUrl(url, specUrl, { selectedServer="" } = {}) { |
| 19 | if (!url) return undefined |
| 20 | if (isAbsoluteUrl(url)) return url |
| 21 | |
| 22 | const baseUrl = buildBaseUrl(selectedServer, specUrl) |
| 23 | if (!isAbsoluteUrl(baseUrl)) { |
| 24 | return new URL(url, window.location.href).href |
| 25 | } |
| 26 | return new URL(url, baseUrl).href |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Safe version of buildUrl function. `selectedServer` can contain server variables |
no test coverage detected
searching dependent graphs…