param page param perPage param total returns const paginate = ( page = 1 , perPage = 25 , total ) : { current : number ; prev : number ; next : number ; } => { const sumOfPages = Math . ceil ( total / perPage ) ; return { current : page || 1 , prev : page > 1 ? page - 1 : null , next : page < sumOfPages ? page + 1 : null } ; } ; export { paginate } ;