You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
776 B
31 lines
776 B
2 years ago
|
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')();
|
||
|
}
|
||
|
})();
|
||
|
// assign defines
|
||
|
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] = {});
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
//# sourceMappingURL=env.mjs.map
|