Skip to content

Commit aeb1434

Browse files
Add coercion Http2Stream -> Duplex
1 parent 35f755a commit aeb1434

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Node/Http2/Stream.purs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Node.Http2.Stream
2-
( onAbort
2+
( toDuplex
3+
, onAbort
34
, onClose
45
, onError
56
, onFrameError
@@ -55,7 +56,12 @@ import Effect.Uncurried (EffectFn1, EffectFn2, EffectFn3, EffectFn4, mkEffectFn1
5556
import Node.FS (FileDescriptor)
5657
import Node.Http2.Types (Client, Headers, Http2Session, Http2Stream, Server)
5758
import Node.Path (FilePath)
59+
import Node.Stream (Duplex)
5860
import Partial.Unsafe (unsafeCrashWith)
61+
import Unsafe.Coerce (unsafeCoerce)
62+
63+
toDuplex :: forall peer. Http2Stream peer -> Duplex
64+
toDuplex = unsafeCoerce
5965

6066
onAbort :: forall peer. Http2Stream peer -> Effect Unit -> Effect Unit
6167
onAbort s cb = runEffectFn2 onAbortImpl s cb

0 commit comments

Comments
 (0)