Fixes issues with global.

This commit is contained in:
Henning Dieterichs
2021-06-22 09:59:50 +02:00
parent 683f1e1f76
commit cd88168211
15 changed files with 281 additions and 240 deletions

View File

@@ -0,0 +1,11 @@
export function getGlobal(): any {
if (typeof globalThis === "object") {
return globalThis;
} else if (typeof global === "object") {
return global;
} else if (typeof window === "object") {
return window;
}
throw new Error("No global available");
}