Skip to content

Commit 2edab44

Browse files
committed
work around invalid es6 code generated
ref rescript-lang/rescript#2456
1 parent a1c5a92 commit 2edab44

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/bs_node_fetch.ml

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[%%raw "import NodeFetch from 'node-fetch'"]
2+
13
type body
24
type bodyInit
35
type headers
@@ -364,7 +366,11 @@ module Response = struct
364366
end
365367

366368

367-
external fetch : string -> response Js.Promise.t = "node-fetch" [@@bs.module]
368-
external fetchWithInit : string -> requestInit -> response Js.Promise.t = "node-fetch" [@@bs.module]
369-
external fetchWithRequest : request -> response Js.Promise.t = "node-fetch" [@@bs.module]
370-
external fetchWithRequestInit : request -> requestInit -> response Js.Promise.t = "node-fetch" [@@bs.module]
369+
external fetch : string -> response Js.Promise.t = "NodeFetch" [@@bs.val]
370+
external fetchWithInit : string -> requestInit -> response Js.Promise.t = "NodeFetch" [@@bs.val]
371+
external fetchWithRequest : request -> response Js.Promise.t = "NodeFetch" [@@bs.val]
372+
external fetchWithRequestInit : request -> requestInit -> response Js.Promise.t = "NodeFetch" [@@bs.val]
373+
let fetch = fetch
374+
let fetchWithInit = fetchWithInit
375+
let fetchWithRequest = fetchWithRequest
376+
let fetchWithRequestInit = fetchWithRequestInit

0 commit comments

Comments
 (0)