Files
discord-decomp/_bundle/deepDiffer.js
T
2026-11-01 12:12:55 +02:00

68 lines
1.8 KiB
JavaScript

// Metro module 147 (f148).
let c147_0;
const deepDiffer = function deepDiffer(a0, a1, r8 = -1) {
const r15 = typeof r8 === "number" ? arguments[3] : r8;
const r12 = typeof r8 === "number" ? r8 : -1;
if (r12 === 0) {
return true;
}
if (a0 === a1) {
return false;
}
if (typeof a0 === "function" && typeof a1 === "function") {
let r61 = r15?.unsafelyIgnoreFunctions;
if (r61 == null) {
const r63 = (c147_0 ? !c147_0.onDifferentFunctionsIgnored : !c147_0) || r15 && "unsafelyIgnoreFunctions" in r15;
r61 = true;
if (!r63) {
c147_0.onDifferentFunctionsIgnored(a0.name, a1.name);
r61 = true;
}
}
return !r61;
}
if (typeof a0 === "object" && a0 !== null) {
if (typeof a1 === "object" && a1 !== null) {
if (a0.constructor !== a1.constructor) {
return true;
}
if (Array.isArray(a0)) {
const length = a0.length;
if (a1.length !== length) {
return true;
}
const r43 = 0 < length;
let r45 = 0;
if (r43) {
do {
const r52 = deepDiffer(a0[r45], a1[r45], r12 - 1, r15);
const r53 = r45;
if (r52) {
return true;
}
r45 = r53 + 1;
} while (r45 < length);
}
} else {
for (const key in a0) {
if (deepDiffer(a0[key], a1[key], r12 - 1, r15)) {
return true;
}
}
for (const key2 in a1) {
if (a0[key2] === void 0 && a1[key2] !== void 0) {
return true;
}
}
}
return false;
}
return true;
}
return a0 !== a1;
};
deepDiffer.unstable_setLogListeners = function unstable_setLogListeners(a0) {
c147_0 = a0;
};
export default deepDiffer;