Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Canceled after 0s
19 lines
612 B
Plaintext
19 lines
612 B
Plaintext
//#region src/client/env.ts
|
|
const context = (() => {
|
|
if (typeof globalThis !== "undefined") return globalThis;
|
|
else if (typeof self !== "undefined") return self;
|
|
else if (typeof window !== "undefined") return window;
|
|
else return Function("return this")();
|
|
})();
|
|
const defines = __DEFINES__;
|
|
Object.keys(defines).forEach((key) => {
|
|
const segments = key.split(".");
|
|
let target = context;
|
|
for (let i = 0; i < segments.length; i++) {
|
|
const segment = segments[i];
|
|
if (i === segments.length - 1) target[segment] = defines[key];
|
|
else target = target[segment] || (target[segment] = {});
|
|
}
|
|
});
|
|
//#endregion
|