We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9857b9 commit 2406275Copy full SHA for 2406275
packages/react-async/src/globalScope.ts
@@ -11,9 +11,10 @@ declare type GlobalScope = {
11
* This file is excluded from coverage reporting because these globals are environment-specific so we can't test them all.
12
*/
13
const globalScope = (() => {
14
+ const glbl = global as any
15
if (typeof self === "object" && self.self === self) return self
- if (typeof global === "object" && global.global === global) return global
16
- if (typeof global === "object" && global["GLOBAL"] === global) return global
+ if (typeof glbl === "object" && glbl.global === glbl) return glbl
17
+ if (typeof glbl === "object" && glbl.GLOBAL === glbl) return glbl
18
return {} // fallback that relies on imported modules to be singletons
19
})() as GlobalScope
20
0 commit comments