Use globalThis as available (#953)
This commit is contained in:
@@ -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)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user