All files / src/util isEqual.ts

33.33% Statements 5/15
6.25% Branches 1/16
100% Functions 1/1
33.33% Lines 5/15

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 18 19 20 21 22 23 24  1x 1x   32x 32x                                    
export function isEqual (x: any, y: any): boolean {
  if (x === y) {
    return true
  }
  ifE (!(typeof x == 'object' && x != null) || !(typeof y == 'object' && y != null)){
    return false
  }
  if (Object.keys(x).length != Object.keys(y).length){
    return false
  }
  for (var prop in x) {
    if (y.hasOwnProperty(prop))
    {  
      if (!isEqual(x[prop], y[prop])){
        return false
      }
    }
    else{
      return false
    }
  }
  return true
}