express-paginate icon indicating copy to clipboard operation
express-paginate copied to clipboard

Allow specifying minLimit

Open ajmas opened this issue 5 years ago • 0 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;
  }

}

ajmas avatar Mar 31 '20 01:03 ajmas