const oldValue = [
{
Details: [{
Amount: 100,
CurrencyCode: 'USD',
Quantity: 2,
RegisteredPrice: 20,
id: 10,
}],
Type: 'Variable',
Product: 'NaN',
id: 10,
},
{
Details: [{
Amount: 110,
CurrencyCode: 'USD',
Quantity: 16,
RegisteredPrice: 20,
id: 20,
}],
Type: 'Type-11',
Product: 'Product-11',
id: 20,
},
{
Details: [{
Amount: 120,
CurrencyCode: 'USD',
Quantity: 17,
RegisteredPrice: 20,
id: 30,
}],
Type: 'Type-12',
Product: 'Product-12',
id: 30,
},
];
const newValue = [
{
Details: [{
Amount: 100,
CurrencyCode: 'USD',
Quantity: 2,
RegisteredPrice: 20,
id: 40,
}],
Type: 'Variable',
Product: 'NaN',
id: 40,
},
{
Details: [{
Amount: 100,
CurrencyCode: 'USD',
Quantity: 2,
RegisteredPrice: 20,
id: 10,
}],
Type: 'Variable',
Product: 'NaN',
id: 10,
},
{
Details: [{
Amount: 120,
CurrencyCode: 'USD',
Quantity: 17,
RegisteredPrice: 20,
id: 30,
}],
Type: 'Type-12',
Product: 'Product-12',
id: 30,
},
];
function hashFn(x) {
return x.id;
}
console.log(jiff.diff(oldValue,newValue,{hash: hashFn,invertible:false}));