const f = (e, n, a) => {
  const t = n.split(".");
  for (; t.length && e; ) {
    const r = t.shift(), s = r ? new RegExp("(.+)\\[([0-9]*)\\]").exec(r) : null;
    if (s !== null && s.length === 3) {
      const l = {
        arrName: s[1],
        arrIndex: s[2]
      };
      if (e[l.arrName] !== void 0) {
        if (t.length === 0)
          return e[l.arrName][l.arrIndex];
        e = e[l.arrName][l.arrIndex];
      } else
        e = a ?? void 0;
      continue;
    }
    if (r && e[r] !== void 0) {
      if (t.length === 0)
        return e[r];
      e = e[r];
    } else
      e = a ?? void 0;
  }
  return e;
}, i = (e, n) => {
  if (e === n)
    return !0;
  if (typeof e != "object" || e === null || typeof n != "object" || n === null)
    return !1;
  const a = Object.keys(e), t = Object.keys(n);
  if (a.length !== t.length)
    return !1;
  for (let r of a)
    if (!n.hasOwnProperty(r) || !i(e[r], n[r]))
      return !1;
  return !0;
};
export {
  f as data_get,
  i as deepEqual
};
