global.js 386 B

12345678910111213141516171819202122
  1. "use strict";
  2. /**
  3. * A reference to the global object
  4. *
  5. * @type {object} globalObject
  6. */
  7. var globalObject;
  8. /* istanbul ignore else */
  9. if (typeof global !== "undefined") {
  10. // Node
  11. globalObject = global;
  12. } else if (typeof window !== "undefined") {
  13. // Browser
  14. globalObject = window;
  15. } else {
  16. // WebWorker
  17. globalObject = self;
  18. }
  19. module.exports = globalObject;