File tree Expand file tree Collapse file tree 2 files changed +22
-21
lines changed Expand file tree Collapse file tree 2 files changed +22
-21
lines changed Original file line number Diff line number Diff line change 1
- 'use strict'
2
- // ref: https://github.com/tc39/proposal-global
3
- var getGlobal = function ( ) {
4
- // the only reliable means to get the global object is
5
- // `Function('return this')()`
6
- // However, this causes CSP violations in Chrome apps.
7
- if ( typeof self !== 'undefined' ) {
8
- return self
9
- }
10
- if ( typeof window !== 'undefined' ) {
11
- return window
12
- }
13
- if ( typeof global !== 'undefined' ) {
14
- return global
15
- }
16
- throw new Error ( 'unable to locate global object' )
17
- }
1
+ /*globals self, window */
2
+ "use strict"
18
3
19
- var global = getGlobal ( )
4
+ /*eslint-disable @mysticatea/prettier */
5
+ const { AbortController, AbortSignal } =
6
+ typeof self !== "undefined" ? self :
7
+ typeof window !== "undefined" ? window :
8
+ /* otherwise */ undefined
9
+ /*eslint-enable @mysticatea/prettier */
20
10
21
- module . exports = exports = global . AbortController
22
- // Needed for TypeScript and Webpack.
23
- exports . default = global . AbortController
11
+ module . exports = AbortController
12
+ module . exports . AbortSignal = AbortSignal
13
+ module . exports . default = AbortController
Original file line number Diff line number Diff line change
1
+ /*globals self, window */
2
+
3
+ /*eslint-disable @mysticatea/prettier */
4
+ const { AbortController, AbortSignal } =
5
+ typeof self !== "undefined" ? self :
6
+ typeof window !== "undefined" ? window :
7
+ /* otherwise */ undefined
8
+ /*eslint-enable @mysticatea/prettier */
9
+
10
+ export default AbortController
11
+ export { AbortController , AbortSignal }
You can’t perform that action at this time.
0 commit comments