diff --git a/src/global-scope.js b/src/global-scope.js index f7aadec0..efa9efc5 100644 --- a/src/global-scope.js +++ b/src/global-scope.js @@ -1,2 +1,17 @@ -const GlobalScope = typeof window !== 'undefined' ? window : self; +/* global globalThis */ +const GlobalScope = (() => { + if (typeof globalThis !== 'undefined') { + return globalThis; + } + if (typeof window !== 'undefined') { + return window; + } + if (typeof self !== 'undefined') { + return self; + } + if (typeof global !== 'undefined') { + return global; + } +})(); + export default GlobalScope;