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

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
export function callJSRequest<Body, Return>( func: (req: Request) => Return, url: string, body: Body, auth: string, requestID: string,): Return { const init = { headers: { // eslint-disable-next-line @typescript-eslint/naming-convention 'Content-type': 'application/json', // eslint-disable-next-line @typescript-eslint/naming-convention 'Authorization': auth, // eslint-disable-next-line @typescript-eslint/naming-convention 'X-Replicache-RequestID': requestID, }, body: JSON.stringify(body), method: 'POST', };
const request = new Request(url, init); return func(request);}
replicache

Version Info

Tagged at
2 years ago