mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 12:41:54 +03:00
f8aa0509ce
swc_bundler: - Prevent infinite recursions. (#1963)
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
|
|
}
|