deno.land / x / replicache@v10.0.0-beta.0 / http-request.ts

http-request.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import type {HTTPRequestInfo} from './http-request-info';
/** * This is used by the defaultPuller and defaultPusher to reduce code * duplication. */export async function httpRequest( request: Request,): Promise<{httpRequestInfo: HTTPRequestInfo; response: Response}> { const response = await fetch(request); const httpStatusCode = response.status; const errorMessage = httpStatusCode === 200 ? '' : await response.text(); return { response, httpRequestInfo: { httpStatusCode, errorMessage, }, };}
replicache

Version Info

Tagged at
2 years ago