All files / src/background/methods objectEquals.ts

0% Statements 0/7
0% Branches 0/4
0% Functions 0/2
0% Lines 0/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17                                 
function objectEquals(object1:object|any, object2:object|any):boolean {
    let areEqual = true;
 
    //keylength
    if (Object.keys(object1).length === Object.keys(object2).length) return false;
 
    //compare keys
    Object.keys(object1).forEach((key) => {
        if (object1[key] !== object2[key]) {
            areEqual = false;
        }
    });
 
    return areEqual;
}
 
export default objectEquals;