browser.js 479 B

12345678910111213141516171819202122
  1. 'use strict'
  2. const _global =
  3. typeof self !== 'undefined'
  4. ? self
  5. : typeof window !== 'undefined'
  6. ? window
  7. : /* otherwise */ undefined
  8. if (!_global) {
  9. throw new Error(
  10. `Unable to find global scope. Are you sure this is running in the browser?`
  11. )
  12. }
  13. if (!_global.AbortController) {
  14. throw new Error(
  15. `Could not find "AbortController" in the global scope. You need to polyfill it first`
  16. )
  17. }
  18. module.exports.AbortController = _global.AbortController