moveMetadataArrayItem = (state, namePrefix, srcInd, targetInd) => {
  let tmpState = cloneDeep(state);
  let arr = eval(`tmpState.${namePrefix}`);
  if (!_.isArray(arr)) return tmpState.metadata;
  arr.splice(targetInd, 0, arr.splice(srcInd, 1)[0]);
  return tmpState.metadata;
}
Returns the metadata of the state with the sorted array. Moves the array item to
target index, shifts the rest of them. If the given path is not an array,
returns the original metadata. Does not mutate the given state.
@param {Object} state
@param {String} namePrefix
@param {Number} srcInd
@param {Number} targetInd
@return {Object} metadata