Skip to content

Commit

Permalink
fix: check for globalThis before fallback to shims (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-fadaei authored Oct 22, 2021
1 parent aa8ca6a commit b5c0c3b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export * from './base'

// ref: https://github.com/tc39/proposal-global
const getGlobal = function () {
if (typeof globalThis !== 'undefined') { return globalThis }
if (typeof self !== 'undefined') { return self }
if (typeof window !== 'undefined') { return window }
if (typeof global !== 'undefined') { return global }
Expand Down

0 comments on commit b5c0c3b

Please sign in to comment.