code: function validateSize(size) {
    size = size && isFinite(size) ? size : DEFAULT_SEARCH_SIZE;
    if (size > MAX_SEARCH_SIZE) {
      return MAX_SEARCH_SIZE;
    } else if (size < 1) {
      return 1;
    }
    return size;
  }
docs: Validate a given size & checks if the value is in the correct bounds: >= 1 <= MAX_SEARCH_SIZE