code: function range(start, end) {
    return {
      start: start,
      end: end === undefined ? start : end
    };
  }
docs: Utility method for creating a new selection range {start, end} object.
  
  @param {Number} start
  @param {Number} [end]
  
  @return {Object} selection range as {start, end}