import type { NextFunction , Request , RequestHandler , Response } from 'express' ; param handler export function asyncHandler ( handler ) { return ( req , res , next ) : void => { const handlerResult = handler ( req , res , next ) ; Promise . resolve ( handlerResult ) . catch ( next ) ; } ; }