export function arrayToObjectByIndex (array) {
  if (!Array.isArray(array)) {
    throw new TypeError("Invalid input: arrayToObjectById expects an array.");
  }
  
  return array.reduce((acc, item, index) => ({
    ...acc,
    [index]: item,
  }), {});
};
