var Immutable = require('immutable');

var is = Immutable.is.bind(Immutable),
    getKeys = Object.keys.bind(Object);

function shallowEqualImmutable(objA, objB) {
  if (is(objA, objB)) {
    return true;
  }
  var keysA = getKeys(objA),
      keysB = getKeys(objB),
      keysAlength = keysA.length,
      keysBlength = keysB.length
      
  if(keysAlength !== keysBlength) {
    return false;
  }
  
  // Test for A's keys different from B.
  for(var i = 0; i < keysAlength; i++) {
    if (!objB.hasOwnProperty(keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]]) ) {
      return false;
    }
  }
  
  // Now we dont need to test for B's keys missing from A,
  // because if length's is same and prev check success - objB hasn't more keys
  return true;
}

module.exports = shallowEqualImmutable;

var Immutable = require('immutable');

var is = Immutable.is.bind(Immutable);

function shallowEqualImmutable(objA, objB) {
  if (objA === objB || is(objA, objB)) {
    return true;
  }

  if (typeof objA !== 'object' || objA === null ||
      typeof objB !== 'object' || objB === null) {
    return false;
  }
  
  var keysA = Object.keys(objA);
  var keysB = Object.keys(objB);

  if (keysA.length !== keysB.length) {
    return false;
  }

  // Test for A's keys different from B.
  var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
  for (var i = 0; i < keysA.length; i++) {
    if (!bHasOwnProperty(keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
      return false;
    }
  }

  return true;
}

module.exports = shallowEqualImmutable;

Make more similar to original version