Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/global-scope.js
Original file line number Diff line number Diff line change
@@ -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;