swc/bundler/tests/.cache/deno/5d63ba471af278e4b97f5d7e036868297c75882f.ts
강동윤 f8aa0509ce
fix(bundler): Fix stack overflow (#2080)
swc_bundler:
 - Prevent infinite recursions. (#1963)
2021-08-15 02:37:31 +00:00

17 lines
476 B
TypeScript

// Loaded from https://deno.land/x/tinyhttp@0.1.18/extensions/res/send/sendStatus.ts
import { Req, Res } from '../../../deps.ts'
import { status } from 'https://deno.land/x/status@0.1.0/status.ts'
export const sendStatus =
<Request extends Req = Req, Response extends Res = Res>(req: Request, res: Response) =>
(statusCode: number): Response => {
req.respond({
...res,
body: status.pretty(statusCode),
status: statusCode
})
return res
}