function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
//helper function to make sure any arrays coming in

import shortid from "shortid";

//get converted to objects with unique ids
export default function arrayToObjWithIds(array) {
  var newObj = {};
  array.forEach(function (item) {
    var newItem = _extends({}, item, {
      id: item.id || shortid()
    });
    newObj[newItem.id] = newItem;
  });
  return newObj;
}