mirror of
https://github.com/directus/directus.git
synced 2026-01-29 12:27:55 -05:00
7 lines
259 B
TypeScript
7 lines
259 B
TypeScript
import type { RequestHandler, Request, Response, NextFunction } from 'express';
|
|
|
|
const asyncHandler = (fn: RequestHandler) => (req: Request, res: Response, next: NextFunction) =>
|
|
Promise.resolve(fn(req, res, next)).catch(next);
|
|
|
|
export default asyncHandler;
|