swc/crates/swc_bundler/tests/.cache/deno/81aaef5553ea90204ab831616cd04354bc4f57b4.ts
2021-11-09 20:42:49 +09:00

12 lines
339 B
TypeScript

// Loaded from https://deno.land/x/tinyhttp@0.1.18/extensions/res/end.ts
import { Req, Res } from '../../deps.ts'
export const end = <Request extends Req = Req, Response extends Res = Res>(req: Request, res: Response) => (
body: string | Uint8Array | Deno.Reader | undefined = ''
) => {
req.respond({ ...res, body })
return res
}