updateMetadataFieldKey = (state, namePrefix, fieldKey, newKey) => {
  let tmpState = cloneDeep(state);
  let field = eval(`tmpState.${namePrefix}`);
  if (field === undefined) return tmpState.metadata;
  if (_.has(field, newKey)) return tmpState.metadata;
  field = Object.keys(field).reduce((result, current) => {
    if (current === fieldKey) result[newKey] = field[current];
    else result[current] = field[current];
    return result;
  }, {});
  eval(`tmpState.${namePrefix} = field`);
  return tmpState.metadata;
}
Returns the metadata of the state with the updated key. If the field does not
exist or the key already exists, returns the original metadata. Does not
mutate the given state.
@param {Object} state
@param {String} namePrefix
@param {String} fieldKey
@param {String} newKey
@return {Object} metadata