convertMetadataField = (state, nameAttr, convertType) => {
  let tmpState = cloneDeep(state);
  let field = eval(`tmpState.${nameAttr}`);
  if (field === undefined) return tmpState.metadata;
  if (convertType === 'array') field = [''];
  else if (convertType === 'object') {
    let key = `New field ${state.new_field_count}`;
    field = { [key]: '' };
  } else field = '';
  eval(`tmpState.${nameAttr} = field`);
  return tmpState.metadata;
}
Returns the metadata of the state with the converted type of given path(nameAttr).
If the field does not exist, returns the original metadata.
Does not mutate the given state.
@param {Object} state
@param {String} nameAttr
@param {String} convertType
@return {Object} metadata