/**
 * Apply sorting from `fromPosition` to `toPosition`
 * @param {object[]} itemList
 * @param {number} fromPosition
 * @param {number}
 * @returns {object[]}
 */
export default function sortItemList (itemList, fromPosition, toPosition) {
  const items = [...itemList];
  const item = items.splice(fromPosition, 1)[0];
  items.splice(toPosition, 0, item);
  return items;
}
