swc/crates/swc_bundler/tests/.cache/deno/81aaef5553ea90204ab831616cd04354bc4f57b4.ts

12 lines
339 B
TypeScript
Raw Normal View History

// 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
}