We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 24f9908 + 8d1f0b5 commit 12544ffCopy full SHA for 12544ff
src/utils/connect/fetch.ts
@@ -1,9 +1,8 @@
1
import { LibraryError } from '../errors';
2
3
-export default (typeof fetch !== 'undefined' && fetch) ||
4
- (typeof globalThis !== 'undefined' && globalThis.fetch) ||
+export default (typeof globalThis !== 'undefined' && globalThis.fetch.bind(globalThis)) ||
5
(typeof window !== 'undefined' && window.fetch.bind(window)) ||
6
- (typeof global !== 'undefined' && global.fetch) ||
+ (typeof global !== 'undefined' && global.fetch.bind(global)) ||
7
((() => {
8
throw new LibraryError(
9
"'fetch()' not detected, use the 'baseFetch' constructor parameter to set it"
0 commit comments