Merge pull request #434 from PatrickShaw/globalThis-add

Prefer globalThis over window and global
This commit is contained in:
Kevin Jahns
2022-06-15 12:04:09 +02:00
committed by GitHub

View File

@@ -93,7 +93,9 @@ export {
UpdateEncoderV1 UpdateEncoderV1
} from './internals.js' } from './internals.js'
const glo = /** @type {any} */ (typeof window !== 'undefined' const glo = /** @type {any} */ (typeof globalThis !== 'undefined'
? globalThis
: typeof window !== 'undefined'
? window ? window
// @ts-ignore // @ts-ignore
: typeof global !== 'undefined' ? global : {}) : typeof global !== 'undefined' ? global : {})