@trinitymirrordigital/deep_equals
Function to deep compare two objects or arrays for changes
Usage
import deepEquals from '@trinitymirrordigital/deep_equals';
const obj1 = {
test: 'foo',
test2: [1, 2, 3]
}
const obj2 = {
test: 'foo',
test2: [1, 2, 3]
}
const obj3 = {
test: 'foo',
test2: [1, 2, 2]
}
obj1 === obj2
deepEquals(obj1, obj2);
obj1 === obj3
deepEquals(obj1, obj3);
const array1 = [{
test: 'foo',
test2: [1, 2, 3]
}]
const array2 = [{
test: 'foo',
test2: [1, 2, 3]
}]
const array3 = [{
test: 'foo',
test2: [1, 2, 2]
}]
array1 === array2
deepEquals(array1, array2);
array1 === array3
deepEquals(array1, array3);