Use globalThis as available (#953)

This commit is contained in:
Jaco
2021-04-21 12:52:10 +02:00
committed by GitHub
parent ba086159ad
commit f3381b0aae
+9 -7
View File
@@ -4,11 +4,13 @@
export { packageInfo } from './packageInfo';
export const xglobal = (
typeof global !== 'undefined'
? global
: typeof self !== 'undefined'
? self
: typeof window !== 'undefined'
? window
: this as unknown as (Window & typeof globalThis)
typeof globalThis !== 'undefined'
? globalThis
: typeof global !== 'undefined'
? global
: typeof self !== 'undefined'
? self
: typeof window !== 'undefined'
? window
: this as unknown as (Window & typeof globalThis)
);