import { NextFunction , Request , Response } from 'express' ; param fn returns function asyncController ( fn ) { return ( req , res , next ) => { Promise . resolve ( fn ( req , res , next ) ) . catch ( next ) ; } ; } export default asyncController ;