import { __exports as u } from "../../../../../../../../_virtual/isNodesEquivalent.js";
import { __require as c } from "../definitions/index.js";
Object.defineProperty(u, "__esModule", {
  value: !0
});
u.default = l;
var s = c();
function l(t, f) {
  if (typeof t != "object" || typeof f != "object" || t == null || f == null)
    return t === f;
  if (t.type !== f.type)
    return !1;
  const y = Object.keys(s.NODE_FIELDS[t.type] || t.type), o = s.VISITOR_KEYS[t.type];
  for (const i of y) {
    const e = t[i], r = f[i];
    if (typeof e != typeof r)
      return !1;
    if (!(e == null && r == null)) {
      if (e == null || r == null)
        return !1;
      if (Array.isArray(e)) {
        if (!Array.isArray(r) || e.length !== r.length)
          return !1;
        for (let n = 0; n < e.length; n++)
          if (!l(e[n], r[n]))
            return !1;
        continue;
      }
      if (typeof e == "object" && !(o != null && o.includes(i))) {
        for (const n of Object.keys(e))
          if (e[n] !== r[n])
            return !1;
        continue;
      }
      if (!l(e, r))
        return !1;
    }
  }
  return !0;
}
//# sourceMappingURL=isNodesEquivalent.js.map
