safeThis.js 523 B

12345678910111213141516171819
  1. /* global globalThis */
  2. /*
  3. This file is copied from `core-js`.
  4. https://github.com/zloirock/core-js/blob/master/packages/core-js/internals/global.js
  5. MIT License
  6. Author: Denis Pushkarev (@zloirock)
  7. */
  8. const check = function (it) {
  9. return it && it.Math == Math && it;
  10. };
  11. module.exports =
  12. check(typeof globalThis == 'object' && globalThis) ||
  13. check(typeof window == 'object' && window) ||
  14. check(typeof self == 'object' && self) ||
  15. check(typeof global == 'object' && global) ||
  16. Function('return this')();