code: function convertToRuleSelection(selection) {
    if (selection.type === 'range') {
      return rangeToRule(selection);
    }
    if (selection.type === 'partition') {
      return partitionToRule(selection);
    }
    if (selection.type === 'empty') {
      return selection;
    }
  
    throw new Error(
      `Convertion to rule not supported with selection of type ${selection.type}`
    );
  }
docs: ----------------------------------------------------------------------------