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

32 lines
1.2 KiB
JavaScript

// Metro module 931 (f932).
import { defineIntegration } from "./setupIntegration";
import { fill } from "./addNonEnumerableProperty";
import { _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan, _INTERNAL_copyFlagsFromScopeToEvent } from "./Module930";
const _wrapAndCaptureBooleanResult = function _wrapAndCaptureBooleanResult(c12576_0) {
return function(...args) {
const r6 = args[0];
const r12 = c12576_0.apply(this, args);
if (typeof r6 === "string" ? typeof r12 === "boolean" : typeof r6 === "string") {
_INTERNAL_insertFlagToScope(r6, r12);
_INTERNAL_addFeatureFlagToActiveSpan(r6, r12);
}
return r12;
};
};
Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module"
});
export const growthbookIntegration = defineIntegration(({ growthbookClass }) => ({
name: "GrowthBook",
setupOnce: () => {
const prototype = growthbookClass.prototype;
if (typeof prototype.isOn === "function") {
fill(prototype, "isOn", _wrapAndCaptureBooleanResult);
}
if (typeof prototype.getFeatureValue === "function") {
fill(prototype, "getFeatureValue", _wrapAndCaptureBooleanResult);
}
},
processEvent: (a0, a1, a2) => _INTERNAL_copyFlagsFromScopeToEvent(a0)
}));