global.js 761 B

123456789101112131415161718
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.getGlobal = void 0;
  4. function checkForMath(potentialGlobal) {
  5. // eslint-disable-next-line eqeqeq
  6. return potentialGlobal && potentialGlobal.Math == Math && potentialGlobal;
  7. }
  8. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  9. function getGlobal() {
  10. // eslint-disable-next-line no-undef
  11. return (checkForMath(typeof globalThis === 'object' && globalThis) ||
  12. checkForMath(typeof window === 'object' && window) ||
  13. checkForMath(typeof self === 'object' && self) ||
  14. checkForMath(typeof global === 'object' && global) ||
  15. Function('return this')());
  16. }
  17. exports.getGlobal = getGlobal;
  18. //# sourceMappingURL=global.js.map