/* eslint-disable */
export function isObj(x) {
  var type = typeof x;
  return x !== null && (type === 'object' || type === 'function');
}
export function range(num, min, max) {
  return Math.min(Math.max(num, min), max);
}
export function deepClone(data) {
  return JSON.parse(JSON.stringify(data));
}
export var isArray = function isArray(value) {
  return Object.prototype.toString.call(value) === '[object Array]';
};
/* 获取树状结构的最大层数 */

export function getTreeMaxFloor(tree) {
  var max = 0;

  var _tree = deepClone(tree);

  var each = function each(cols, floor) {
    return cols.forEach(function (col) {
      if (floor > max) max = floor;

      if (typeof col !== 'string') {
        // eslint-disable-next-line no-param-reassign
        col.floor = floor;
        var _col$children = col.children,
            children = _col$children === void 0 ? [] : _col$children;
        if (children.length) each(children, floor + 1);
      }
    });
  };

  each(_tree, 1);
  return max;
}
export function guid2() {
  var s4 = function s4() {
    var num = Math.random() + 1; // eslint-disable-next-line no-bitwise

    return (num * 0x10000 | 0).toString(16).substring(1);
  };

  return ['adc_picker', s4(), s4(), s4(), s4()].join('_');
} // 判断两个对象是否相等

export function isEqual(x, y) {
  return JSON.stringify(x) === JSON.stringify(y);
}