export function removeEmptyFields(obj) {
  let resultObj = {};
  Object.keys(obj)
    .filter(
      (key) => obj[key] !== undefined && obj[key] !== null && obj[key] !== ""
    )
    .forEach((key) => {
      resultObj[key] = obj[key];
    });
  return resultObj;
}

export function getObjectChangeField(objInit, objUpdate) {
  const resultObj = {};
  Object.keys(objUpdate).forEach((key) => {
    if (objUpdate[key] !== objInit[key]) {
      resultObj[key] = objUpdate[key];
    }
  });
  return resultObj;
}

export function checkChangeData(dataInit, dataChange) {
  let initData = JSON.stringify(dataInit);
  let changeData = JSON.stringify(dataChange);
  return initData !== changeData;
  //Алексей, какого черта!?
  /*if (initData !== changeData) {
    return true;
  } else {
    return false;
  }*/
}
