export const normalizeSpaceSelection = (space, spaces) => {
  if (space && spaces) {
    throw new Error('Provide either "space" or "spaces", not both.');
  }
  if (space) {
    return {
      mode: 'single',
      spaceId: space
    };
  }
  if (spaces === 'all') {
    return {
      mode: 'all'
    };
  }
  if (spaces && spaces.length > 0) {
    return {
      mode: 'many',
      spaceIds: spaces
    };
  }
  throw new Error('Either "space" or non-empty "spaces" must be provided.');
};
//# sourceMappingURL=space-selection.js.map