How to use the @antv/g2/lib/core.Util.isArray function in @antv/g2

To help you get started, we’ve selected a few @antv/g2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / BizCharts / src / shared / util.js View on Github external
function length(obj) {
  if (Util.isArray(obj)) {
    return obj.length;
  } else if (Util.isObject(obj)) {
    return Object.keys(obj).length;
  }

  return 0;
}
github alibaba / BizCharts / src / shared / util.js View on Github external
shallowEqual(objA, objB) {
    if (is(objA, objB)) {
      return true;
    }

    if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
      return false;
    }

    if (Util.isArray(objA) !== Util.isArray(objB)) {
      return false;
    }

    if (length(objA) !== length(objB)) {
      return false;
    }

    let ret = true;

    Util.each(objA, (v, k) => {
      if (!is(v, objB[k])) {
        ret = false;
        return ret;
      }
      return true;
    });