Skip to content

Commit 9e95faf

Browse files
fix: proper exports to allow TS to recognize class types and proper casting (#71)
Co-authored-by: Jacob Ebey <[email protected]>
1 parent c74db27 commit 9e95faf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/fetch/src/lib.node.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import * as WebFetch from "./fetch.js"
1+
import { fetch as webFetch, Headers as WebHeaders, Request as WebRequest, Response as WebResponse } from "./fetch.js"
22

33
export { ReadableStream, Blob, FormData } from './package.js';
44
// Electron-renderer should get the browser implementation instead of node
55
// Browser configuration is not enough
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.bind(globalThis) : WebFetch.fetch)
9+
(typeof globalThis.fetch === "function" ? globalThis.fetch.bind(globalThis) : webFetch)
1010

11-
export const Headers = globalThis.Headers || WebFetch.Headers
12-
export const Request = globalThis.Request || WebFetch.Request
13-
export const Response = globalThis.Response || WebFetch.Response
11+
export const Headers = globalThis.Headers || WebHeaders
12+
export const Request = globalThis.Request || WebRequest
13+
export const Response = globalThis.Response || WebResponse
1414

1515
export default fetch

0 commit comments

Comments
 (0)