forked from starknet-io/starknet.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
106 additions
and
147 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
// the ts-ignore suppresses an esm to cjs import error that is resolved with entry point resolution | ||
// @ts-ignore | ||
import makeFetchCookie from 'fetch-cookie'; | ||
import isomorphicFetch from 'isomorphic-fetch'; | ||
|
||
export default (typeof window !== 'undefined' && window.fetch) || // use buildin fetch in browser if available | ||
(typeof global !== 'undefined' && makeFetchCookie(global.fetch)) || // use buildin fetch in node, react-native and service worker if available | ||
isomorphicFetch; // ponyfill fetch in node and browsers that don't have it | ||
export default (typeof window !== 'undefined' && window.fetch) || | ||
// use built-in fetch in node, react-native and service worker if available | ||
(typeof global !== 'undefined' && global.fetch) || | ||
// throw with instructions when no fetch is detected | ||
((() => { | ||
throw new Error("'fetch()' not detected, use the 'baseFetch' constructor parameter to set it"); | ||
}) as WindowOrWorkerGlobalScope['fetch']); |
Oops, something went wrong.