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

116 lines
4.3 KiB
JavaScript

// Metro module 927 (f928).
import { defineIntegration } from "./setupIntegration";
import { forEachEnvelopeItem } from "./forEachEnvelopeItem";
import { stripMetadataFromStackFrames, addMetadataToStackFrames } from "./Module914";
import { getFramesFromEvent } from "./createStackParser";
let c762_2, c762_3, c762_4;
Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module"
});
const r16 = defineIntegration((c12572_0) => ({
name: "ThirdPartyErrorsFilter",
setup: (a0) => {
let c23906_0 = a0;
a0.on("beforeEnvelope", (a0) => {
forEachEnvelopeItem(a0, (a0, a1) => {
if (a1 === "event") {
const r10 = Array.isArray(a0) ? a0[1] : void 0;
if (r10) {
stripMetadataFromStackFrames(r10);
a0[1] = r10;
}
}
});
});
a0.on("applyFrameMetadata", (a0) => {
if (!a0.type) {
addMetadataToStackFrames(c23906_0.getOptions().stackParser, a0);
}
});
},
processEvent: (a0) => {
const ignoreSentryInternalFrames = c12572_0.ignoreSentryInternalFrames;
const framesFromEvent = getFramesFromEvent(a0);
const r15 = framesFromEvent ? framesFromEvent.filter((item, index) => {
let r47;
let r19 = !!item.filename;
if (r19) {
let r4 = item.lineno != null || item.colno != null || item.instruction_addr != null;
if (r4) {
let r11 = !ignoreSentryInternalFrames;
if (ignoreSentryInternalFrames) {
let r3 = false;
if (index === 0) {
const context_line = item.context_line;
r3 = false;
if (context_line) {
const filename = item.filename;
r3 = false;
if (filename) {
const r29 = item.filename.includes("sentry");
r3 = false;
if (r29) {
const r33 = item.filename.includes("helpers");
r3 = false;
if (r33) {
const r37 = item.context_line.includes(c762_4);
r3 = false;
if (r37) {
const pre_context = item.pre_context;
r3 = false;
if (pre_context) {
const length = item.pre_context.length;
const r5 = 0 < length;
let r41 = 0;
r3 = false;
if (r5) {
do {
const r18 = item.pre_context[r41];
const r43 = r18 == null;
const r1 = r41;
const r44 = r43 ? void 0 : r18.includes(c762_3);
r3 = true;
if (r44) {
break;
}
const r46 = r1 + 1;
r47 = r46 < length;
r41 = r46;
r3 = false;
} while (r47);
}
}
}
}
}
}
}
}
r11 = !r3;
}
r4 = r11;
}
r19 = r4;
}
return r19;
}).map((a0) => a0.module_metadata ? Object.keys(a0.module_metadata).filter((item) => item.startsWith(c762_2)).map((item) => item.slice(c762_2.length)) : []) : void 0;
L10: {
if (r15 && r15[c12572_0.behaviour !== "drop-error-if-contains-third-party-frames" ? c12572_0.behaviour === "apply-tag-if-contains-third-party-frames" ? "some" : "every" : "some"]((a0) => !a0.some((item) => c12572_0.filterKeys.includes(item)))) {
if (c12572_0.behaviour !== "drop-error-if-contains-third-party-frames" && c12572_0.behaviour !== "drop-error-if-exclusively-contains-third-party-frames") {
a0.tags = {
...a0.tags,
third_party_code: true
};
break L10;
}
return null;
}
}
return a0;
}
}));
c762_2 = "_sentryBundlerPluginAppKey:";
c762_3 = "Attempt to invoke user-land function";
c762_4 = "fn.apply(this, wrappedArguments)";
export { r16 as thirdPartyErrorFilterIntegration };