code: function pages(min, max, currentPage, availableSlots) {
    // 1, 2, 3
    if (max - min < availableSlots) {
      return range(min, max);
    } // 1, 2, 3, …, 42
  
  
    if (currentPage - min + 1 < availableSlots - 2) {
      return [].concat((0, _toConsumableArray2.default)(range(min, min - 1 + availableSlots - 2)), [null, max]);
    } // 1, …, 40, 41, 42
  
  
    if (max - currentPage < availableSlots - 2) {
      return [min, null].concat((0, _toConsumableArray2.default)(range(max + 1 - (availableSlots - 2), max)));
    } // 1, …, 21, …, 42
  
  
    var sides = Math.floor((availableSlots - 4) / 2);
    return [min, null].concat((0, _toConsumableArray2.default)(range(currentPage - sides, currentPage + sides)), [null, max]);
  }
docs: Returns an array of size `availableSlots` with page number integers and breaks "…" (represented as nulls).