export default function getDifferences(obj1, obj2) {
    let diff = {};
    delete obj1.$index;
    delete obj2.$index;

    for (let key in obj1) {
        if (obj2[key] && JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])) {
            diff[key] = obj2[key];
        }
    }
    for (let key in obj2) {
        if (
            obj1[key] === undefined ||
            JSON.stringify(obj1[key]) !== JSON.stringify(obj2[key])
        ) {
            diff[key] = obj2[key];
        }
    }

    return diff;
}
