polyfill.js 558 B

123456789101112131415161718192021
  1. /*globals require, self, window */
  2. "use strict"
  3. const ac = require("./dist/abort-controller")
  4. /*eslint-disable @mysticatea/prettier */
  5. const g =
  6. typeof self !== "undefined" ? self :
  7. typeof window !== "undefined" ? window :
  8. typeof global !== "undefined" ? global :
  9. /* otherwise */ undefined
  10. /*eslint-enable @mysticatea/prettier */
  11. if (g) {
  12. if (typeof g.AbortController === "undefined") {
  13. g.AbortController = ac.AbortController
  14. }
  15. if (typeof g.AbortSignal === "undefined") {
  16. g.AbortSignal = ac.AbortSignal
  17. }
  18. }