import { Response } from 'express' ; import { INTERNAL_SERVER_ERROR , OK } from 'http-status' ; param res param status param responseJson export function responseWith ( res , responseJson , status = OK ) { return res . status ( status ) . json ( { ... responseJson , status } ) ; } param res param err param status export function responseErrorWithObject ( res , err , status = INTERNAL_SERVER_ERROR ) { return responseWith ( res , { ... err , status } , status ) ; }