Skip to content

Commit fd32fa2

Browse files
author
Alan Shaw
authored
fix: bind globalThis in nodejs also (#69)
1 parent e338f0c commit fd32fa2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/fetch/src/lib.node.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ export { ReadableStream, Blob, FormData } from './package.js';
66

77
// Marking export as a DOM File object instead of custom class.
88
export const fetch = /** @type {typeof globalThis.fetch} */
9-
(typeof globalThis.fetch === "function" ? globalThis.fetch : WebFetch.fetch)
9+
(typeof globalThis.fetch === "function" ? globalThis.fetch.bind(globalThis) : WebFetch.fetch)
1010

1111
export const Headers = globalThis.Headers || WebFetch.Headers
1212
export const Request = globalThis.Request || WebFetch.Request
13-
export const Response = global.Response || WebFetch.Response
13+
export const Response = globalThis.Response || WebFetch.Response
1414

1515
export default fetch

0 commit comments

Comments
 (0)