const arrBd = [ {id: '1234' , photo_url: 'test.ru/img.jpg ', parent: 'Общие' ,},
{id: '1234567' , photo_url: 'test.ru/img.jpg ', parent: 'Общие' ,} ]
const arrForSite = [ {sku: '1234' , image_url: 'test.ru/img.jpg ', category: 'Общие' ,},
{sku: '1234567' , image_url: 'test.ru/img.jpg ', category: 'Общие' ,} ]
const isDiff = arrBd.find(
(item, index) =>
item.id !== arrForSite[index].sku ||
item.photo_url !== arrForSite[index].image_url ||
item.parent !== arrForSite[index].category
);
if(isDiff) {
console.log('Ключи разные');
}
const findDiff = (arr1, arr2, mapping) =>
arr1.find((item, index) =>
mapping.find((m) => item[m[0]] !== arr2[index][m[1]])
);
const diff = findDiff(arrBd, arrForSite, [
["id", "sku"],
["photo_url", "image_url"],
["parent", "category"],
]);