import y from"./warning.mjs";function h(c,o,a=!1){const f=new Set;function n(e,r,s=1){const i=f.has(e);if(y(!i,"Warning: There may be circular references"),i)return!1;if(e===r)return!0;if(a&&s>1)return!1;f.add(e);const u=s+1;if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(let t=0;t<e.length;t++)if(!n(e[t],r[t],u))return!1;return!0}if(e&&r&&typeof e=="object"&&typeof r=="object"){const t=Object.keys(e);return t.length!==Object.keys(r).length?!1:t.every(l=>n(e[l],r[l],u))}return!1}return n(c,o)}export{h as default};
