Skip to content

Commit

Permalink
work around invalid es6 code generated
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhuman committed Apr 12, 2018
1 parent a1c5a92 commit 1384703
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
14 changes: 10 additions & 4 deletions src/bs_node_fetch.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[%%raw "import NodeFetch from 'node-fetch'"]

type body
type bodyInit
type headers
Expand Down Expand Up @@ -364,7 +366,11 @@ module Response = struct
end


external fetch : string -> response Js.Promise.t = "node-fetch" [@@bs.module]
external fetchWithInit : string -> requestInit -> response Js.Promise.t = "node-fetch" [@@bs.module]
external fetchWithRequest : request -> response Js.Promise.t = "node-fetch" [@@bs.module]
external fetchWithRequestInit : request -> requestInit -> response Js.Promise.t = "node-fetch" [@@bs.module]
external fetch : string -> response Js.Promise.t = "NodeFetch" [@@bs.val]
external fetchWithInit : string -> requestInit -> response Js.Promise.t = "NodeFetch" [@@bs.val]
external fetchWithRequest : request -> response Js.Promise.t = "NodeFetch" [@@bs.val]
external fetchWithRequestInit : request -> requestInit -> response Js.Promise.t = "NodeFetch" [@@bs.val]
let fetch = fetch
let fetchWithInit = fetchWithInit
let fetchWithRequest = fetchWithRequest
let fetchWithRequestInit = fetchWithRequestInit
8 changes: 4 additions & 4 deletions src/bs_node_fetch.mli
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ module Response : sig
external text : string Js.Promise.t = "" [@@bs.send.pipe: t]
end

external fetch : string -> response Js.Promise.t = "node-fetch" [@@bs.module]
external fetchWithInit : string -> requestInit -> response Js.Promise.t = "node-fetch" [@@bs.module]
external fetchWithRequest : request -> response Js.Promise.t = "node-fetch" [@@bs.module]
external fetchWithRequestInit : request -> requestInit -> response Js.Promise.t = "node-fetch" [@@bs.module]
val fetch : string -> response Js.Promise.t
val fetchWithInit : string -> requestInit -> response Js.Promise.t
val fetchWithRequest : request -> response Js.Promise.t
val fetchWithRequestInit : request -> requestInit -> response Js.Promise.t

0 comments on commit 1384703

Please sign in to comment.