mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 14:16:12 +03:00
12 lines
339 B
TypeScript
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
|
|
}
|