function prepareToPublish(payload) {
  if (Array.isArray(payload)) {
    payload.forEach(prepareToPublish);
  } else if (payload && payload.constructor === Object) {
    // eslint-disable-next-line no-prototype-builtins
    if (payload.hasOwnProperty('__component')) {
      delete payload.id;
    }
    Object.values(payload).forEach(prepareToPublish);
  }

  return payload;
}
/**
 * Should remove ID's from components -
 * could modify only already attached componetns (with proper ID)
 * or create new one - in that case removing id will create new one
 * @param {object} payload
 */
Should remove ID's from components
could modify only already attached componetns (with proper ID)
or create new one - in that case removing id will create new one
@param {object} payload
Should remove ID ' s from components could modify only already attached componetns ( with proper ID ) or create new one - in that case removing id will create new one @param { object } payload
function prepareToPublish(payload) {
  if (Array.isArray(payload)) {
    payload.forEach(prepareToPublish);
  } else if (payload && payload.constructor === Object) {
    if (payload.hasOwnProperty('__component')) {
      delete payload.id;
    }
    Object.values(payload).forEach(prepareToPublish);
  }
  return payload;
}
function prepareToPublish ( payload ) { if ( Array . isArray ( payload ) ) { payload . forEach ( prepareToPublish ) ; } else if ( payload && payload . constructor === Object ) { if ( payload . hasOwnProperty ( '__component' ) ) { delete payload . id ; } Object . values ( payload ) . forEach ( prepareToPublish ) ; } return payload ; }
Should remove ID's from components
 could modify only already attached componetns (with proper ID)
 or create new one - in that case removing id will create new one
 @param {object} payload
Should remove ID ' s from components could modify only already attached componetns ( with proper ID ) or create new one - in that case removing id will create new one @param { object } payload
// eslint-disable-next-line no-prototype-builtins