src/shallowEquals.js
function excludeIncludeKeys(objA, objB, excludeKeys, includeKeys) {
  let keysA = Object.keys(objA);
  let keysB = Object.keys(objB);

  if (excludeKeys) {
    keysA = keysA.filter(key => excludeKeys.indexOf(key) === -1);
    keysB = keysB.filter(key => excludeKeys.indexOf(key) === -1);
  } else if (includeKeys) {
    keysA = keysA.filter(key => includeKeys.indexOf(key) !== -1);
    keysB = keysB.filter(key => includeKeys.indexOf(key) !== -1);
  }

  return [keysA, keysB];
}
function excludeIncludeKeys(objA, objB, excludeKeys, includeKeys) {
  let keysA = Object.keys(objA);
  let keysB = Object.keys(objB);

  if (excludeKeys) {
    keysA = keysA.filter(key => excludeKeys.indexOf(key) === -1);
    keysB = keysB.filter(key => excludeKeys.indexOf(key) === -1);
  } else if (includeKeys) {
    keysA = keysA.filter(key => includeKeys.indexOf(key) !== -1);
    keysB = keysB.filter(key => includeKeys.indexOf(key) !== -1);
  }

  return [keysA, keysB];
}
function excludeIncludeKeys ( objA , objB , excludeKeys , includeKeys ) { let keysA = Object . keys ( objA ) ; let keysB = Object . keys ( objB ) ; if ( excludeKeys ) { keysA = keysA . filter ( key => excludeKeys . indexOf ( key ) === - 1 ) ; keysB = keysB . filter ( key => excludeKeys . indexOf ( key ) === - 1 ) ; } else if ( includeKeys ) { keysA = keysA . filter ( key => includeKeys . indexOf ( key ) !== - 1 ) ; keysB = keysB . filter ( key => includeKeys . indexOf ( key ) !== - 1 ) ; } return [ keysA , keysB ] ; }
Helper function to include or exclude keys before comparing
Helper function to include or exclude keys before comparing