fix: export

This commit is contained in:
Antoni Kepinski 2020-05-25 19:20:30 +02:00
parent aab3c605eb
commit 079b11e257
No known key found for this signature in database
GPG Key ID: C15767C6F117A9B6
1 changed files with 2 additions and 4 deletions

View File

@ -29,7 +29,7 @@ export {Headers, Request, Response, FetchError, AbortError, isRedirect};
* @param Object opts Fetch options * @param Object opts Fetch options
* @return Promise * @return Promise
*/ */
const fetch = (url, options_) => { export default function fetch(url, options_) {
// Allow custom promise // Allow custom promise
if (!fetch.Promise) { if (!fetch.Promise) {
throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
@ -288,9 +288,7 @@ const fetch = (url, options_) => {
writeToStream(request_, request); writeToStream(request_, request);
}); });
}; }
export default fetch;
// Expose Promise // Expose Promise
fetch.Promise = global.Promise; fetch.Promise = global.Promise;