// eslint-disable-next-line import/prefer-default-export
export const createInputChanged = actionPrefix => (name, event) => ({
  type: `${actionPrefix}_INPUT_CHANGED`,
  name,
  id: event.target.id,
  startovne: event.target.nonce,
  value: event.target.type === 'checkbox' ? event.target.checked : event.target.value
});

// eslint-disable-next-line import/prefer-default-export
export const createInputChanged = actionPrefix => (name, event) => {
  const action = {
    type: `${actionPrefix}_INPUT_CHANGED`,
    name,
    id: event.target.id,
    value: event.target.type === 'checkbox' ? event.target.checked : event.target.value
  };

  if (event.target.nonce) {
    const startovne = parseInt(event.target.nonce, 10);
    if (!Number.isNaN(startovne)) {
      action.startovne = startovne;
    }
  }

  return action;
};

Convert startovne to a number.
Convert startovne to a number.
