(path: string)
| 14 | }; |
| 15 | |
| 16 | export function buildApiUrl(path: string): string { |
| 17 | if (/^https?:\/\//.test(path)) return path; |
| 18 | const apiBase = (import.meta.env.VITE_API_BASE ?? "").trim(); |
| 19 | if (!apiBase) return path; |
| 20 | return `${apiBase.replace(/\/$/, "")}${path}`; |
| 21 | } |
| 22 | |
| 23 | async function parseResponse<T>(response: Response): Promise<T> { |
| 24 | const contentType = response.headers.get("content-type") ?? ""; |
no outgoing calls
no test coverage detected