expressjs / express-paginate

Paginate middleware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow specifying minLimit

ajmas opened this issue · comments

Since we can now pass ?limit0, would it be worth adding an optional, third parameter to the middleware function, such that:

exports.middleware = function middleware(limit, maxLimit, minLimit) {

}

The alternative is doing something as follows, if we care about order of min and max:

exports.middleware = function middleware(limit, minOrMaxLimit, maxLimit) {
  let minLimit = 0;
  if (maxLimit) {
    minLimit = minOrMaxLimit;
  }

}