Skip to content

Commit 0510651

Browse files
committed
Fix: type error
1 parent 2693665 commit 0510651

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

packages/functions/src/async.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@ import { _traced } from "./traced";
55

66
const logger = moduleLogger("tracer");
77

8-
declare module "express" {
9-
interface Response {
10-
errorLogged?: boolean;
11-
}
12-
}
13-
148
const _asyncHandler =
159
(fn: RequestHandler, trace = false) =>
16-
async (req: Request, res: Response, next: NextFunction) => {
10+
async (req: Request, res: Response & Record<string, any>, next: NextFunction) => {
1711
let fnName: string;
1812
try {
1913
if (trace) {
@@ -54,7 +48,7 @@ export const tracedAsyncHandler = (fn: RequestHandler): RequestHandler => _async
5448
*/
5549
export const fallibleAsyncHandler =
5650
(fn: RequestHandler): RequestHandler =>
57-
async (req, res: Response, next) => {
51+
async (req, res: Response & Record<string, any>, next) => {
5852
try {
5953
await _traced(fn.bind(this, req, res, next), {}, _fnName(fn), null, true);
6054
if (!res.headersSent) next();

0 commit comments

Comments
 (0)