unenv
Version:
`unenv` is a framework-agnostic system that allows converting JavaScript code to be platform agnostic and work in any environment including Browsers, Workers, Node.js, or JavaScript runtime.
22 lines (20 loc) • 400 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
function getGlobal() {
if (typeof globalThis !== "undefined") {
return globalThis;
}
if (typeof self !== "undefined") {
return self;
}
if (typeof window !== "undefined") {
return window;
}
if (typeof global !== "undefined") {
return global;
}
return {};
}
module.exports = getGlobal();