const f = (e, r, n = 0, s) => {
  const {
    maxDepth: p = 10,
    ignoreTypes: g = ["function"],
    compareArrays: m = !0,
    compareObjects: O = !0,
    customComparers: i = {},
    log: h = !1
  } = s || {};
  if (h && process.env.NODE_ENV === "development" && n === 0 && console.log("deepShallow**", e, r, n), n >= p)
    return Object.is(e, r);
  if (e === r)
    return !0;
  if (e == null || r == null || typeof e != "object" || typeof r != "object")
    return e === r;
  if (Array.isArray(e) && Array.isArray(r)) {
    if (!m)
      return Object.is(e, r);
    if (e.length !== r.length)
      return !1;
    for (let t = 0; t < e.length; t++)
      if (!f(e[t], r[t], n + 1, s))
        return !1;
    return !0;
  }
  if (Array.isArray(e) || Array.isArray(r))
    return !1;
  if (!O)
    return Object.is(e, r);
  const u = Object.keys(e), k = Object.keys(r);
  if (u.length !== k.length)
    return !1;
  for (let t = 0; t < u.length; t++) {
    const a = u[t], l = e[a], c = r[a];
    if (g.includes(typeof l))
      continue;
    const y = typeof l;
    if (i[y]) {
      if (!i[y](l, c))
        return !1;
      continue;
    }
    if (!f(l, c, n + 1, s))
      return !1;
  }
  return !0;
}, v = (e) => (r, n, s = 0) => f(r, n, s, e);
export {
  v as createCustomDeepShallow,
  f as deepShallow
};
