(path: string, init?: RequestInit)
| 207 | }) |
| 208 | |
| 209 | function request(path: string, init?: RequestInit) { |
| 210 | const url = new URL(path, "http://localhost") |
| 211 | return HttpClientRequest.fromWeb(new Request(url, init)).pipe( |
| 212 | HttpClientRequest.setUrl(url.pathname), |
| 213 | HttpClient.execute, |
| 214 | ) |
| 215 | } |
| 216 | |
| 217 | function json<T>(response: HttpClientResponse.HttpClientResponse) { |
| 218 | if (response.status !== 200) return response.text.pipe(Effect.flatMap((text) => Effect.die(new Error(text)))) |
no outgoing calls
no test coverage detected