Skip to content

Commit 12544ff

Browse files
authored
Merge pull request #1391 from aryzing/update-fetch-checks
fix: update fetch checks
2 parents 24f9908 + 8d1f0b5 commit 12544ff

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/utils/connect/fetch.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { LibraryError } from '../errors';
22

3-
export default (typeof fetch !== 'undefined' && fetch) ||
4-
(typeof globalThis !== 'undefined' && globalThis.fetch) ||
3+
export default (typeof globalThis !== 'undefined' && globalThis.fetch.bind(globalThis)) ||
54
(typeof window !== 'undefined' && window.fetch.bind(window)) ||
6-
(typeof global !== 'undefined' && global.fetch) ||
5+
(typeof global !== 'undefined' && global.fetch.bind(global)) ||
76
((() => {
87
throw new LibraryError(
98
"'fetch()' not detected, use the 'baseFetch' constructor parameter to set it"

0 commit comments

Comments
 (0)