mirror of
https://github.com/swc-project/swc.git
synced 2024-12-30 17:15:11 +03:00
f8aa0509ce
swc_bundler: - Prevent infinite recursions. (#1963)
17 lines
476 B
TypeScript
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
|
|
}
|