(input: string)
| 20 | } |
| 21 | |
| 22 | export function normalizeBaseUrl(input: string): string { |
| 23 | let url = input.trim().replace(/\/+$/, '') |
| 24 | if (url && !/^https?:\/\//i.test(url)) { |
| 25 | url = `http://${url}` |
| 26 | } |
| 27 | if (url && !url.endsWith('/api/v1')) { |
| 28 | url = url.replace(/\/api\/v1$/, '') + '/api/v1' |
| 29 | } |
| 30 | return url |
| 31 | } |
| 32 | |
| 33 | function isValidDataSourceArray(data: unknown): data is DataSource[] { |
| 34 | if (!Array.isArray(data)) return false |
no outgoing calls
no test coverage detected