deno.land / x / ky@v0.31.3 / test / helpers / parse-body.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
import body from 'raw-body';import type {Request} from 'express';
export const parseJsonBody = async <T = any>(request: Request): Promise<T> => { const buffer = await body(request); return JSON.parse(buffer.toString()) as T;};
export const parseRawBody = async (request: Request): Promise<string> => { const buffer = await body(request); return buffer.toString();};
ky

Version Info

Tagged at
a year ago