Skip to content

Commit 8b66db0

Browse files
committed
fix: global fetch
1 parent 80a02f0 commit 8b66db0

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/fetch/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import realFetch from "node-fetch";
22
import wrapper from "./wrapper";
33

44
if (!global.fetch) {
5-
global.fetch = module.exports;
5+
global.fetch = realFetch;
66
global.Response = realFetch.Response;
77
global.Headers = realFetch.Headers;
88
global.Request = realFetch.Request;

packages/fetch/src/wrapper.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import qs from "qs";
22
import { pickBy, identity } from "lodash";
33
import createError from "http-errors";
44

5-
const realFetch = fetch || window.fetch || global.fetch;
6-
75
/**
86
* A wrapper of fetch
97
*
@@ -23,7 +21,7 @@ export default async function(url, opt = {}) {
2321
...headers,
2422
};
2523

26-
const res = await realFetch(
24+
const res = await fetch(
2725
endpoint,
2826
pickBy(
2927
{

0 commit comments

Comments
 (0)