swc/bundler/tests/.cache/deno/81aaef5553ea90204ab831616cd04354bc4f57b4.ts
강동윤 f8aa0509ce
fix(bundler): Fix stack overflow (#2080)
swc_bundler:
 - Prevent infinite recursions. (#1963)
2021-08-15 02:37:31 +00: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
}