var _isObjectEqual = function isObjectEqual(obj1, obj2) {
  var _a, _b;
  var o1 = obj1 instanceof Object;
  var o2 = obj2 instanceof Object;
  // 如果不是对象 直接判断数据是否相等
  if (!o1 || !o2) {
    return obj1 === obj2;
  }
  // 类型转换为对象进行后续操作
  var obj1Record = obj1;
  var obj2Record = obj2;
  // 判断对象的可枚举属性组成的数组长度
  if (Object.keys(obj1Record).length !== Object.keys(obj2Record).length) {
    return false;
  }
  // eslint-disable-next-line no-restricted-syntax
  for (var attr in obj1Record) {
    if (Object.prototype.hasOwnProperty.call(obj1Record, attr)) {
      var type1 = Object.prototype.toString.call(obj1Record[attr]) == '[object Object]';
      var type2 = Object.prototype.toString.call(obj2Record[attr]) == '[object Object]';
      var arr1 = Object.prototype.toString.call(obj1Record[attr]) == '[object Array]';
      if (type1 && type2) {
        // 如果是对象继续判断
        return _isObjectEqual(obj1Record[attr], obj2Record[attr]);
      }
      if (arr1) {
        // 如果是数组 判断
        if (((_a = obj1Record[attr]) === null || _a === void 0 ? void 0 : _a.toString()) != ((_b = obj2Record[attr]) === null || _b === void 0 ? void 0 : _b.toString())) {
          return false;
        }
      } else if (obj1Record[attr] !== obj2Record[attr]) {
        // 不是对象的就判断数值是否相等
        return false;
      }
    }
  }
  return true;
};

export { _isObjectEqual as isObjectEqual };
