INNER CODE UNIT · JavaScript

PaginationParametersHelper

aravindnc/mongoose-paginate-v2 · src/pagination-parameters.js:1

class PaginationParametersHelper {
  constructor(request) {
    this.query = request.query;
  }

  /**
   * Handle boolean options
   * If the 'option'-Parameter is a string, check if it equals 'true'
   * If not, it should be a boolean, and can be returned as it is.
   *
   * @param {string|boolean} option
   * @return {boolean}
   * */
  booleanOpt(option) {
    return typeof option === 'string' ? option === 'true' : option;
  }

  /**

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…