All files shallow-differs.js

100% Statements 10/10
100% Branches 8/8
100% Functions 1/1
100% Lines 6/6
1 2 3 4 5 6 7 8 9 10 11      19x 18x 16x 28x 27x   6x  
// @flow
 
export function shallowDiffers(a: any, b: any) {
    if(typeof a !== typeof b) return true;
    if (typeof a !== 'object') return a != b;
    for (let i in a) {
        if (!(i in b)) return true;
        if (a[i] !== b[i]) return true;
    }
    return false
}