File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,9 +2,8 @@ const grpc = require('@grpc/grpc-js')
22const maybe = require ( 'call-me-maybe' )
33const collectStream = require ( 'stream-collector' )
44const pumpify = require ( 'pumpify' )
5- const map = require ( 'through2-map' )
65const codecs = require ( 'codecs' )
7- const { Writable } = require ( 'streamx' )
6+ const { Writable, Transform } = require ( 'streamx' )
87
98const { Stat } = require ( 'hyperdrive-schemas' )
109const { drive : { services, messages } } = require ( '../rpc.js' )
@@ -233,11 +232,13 @@ class RemoteHyperdrive {
233232 const call = this . _client . createDiffStream ( req , toMetadata ( { token : this . token } ) )
234233 return pumpify . obj (
235234 call ,
236- map . obj ( rsp => {
237- return {
238- type : rsp . getType ( ) ,
239- name : rsp . getName ( ) ,
240- value : fromDiffEntry ( rsp . getValue ( ) )
235+ new Transform ( {
236+ transform ( rsp , cb ) {
237+ return cb ( null , {
238+ type : rsp . getType ( ) ,
239+ name : rsp . getName ( ) ,
240+ value : fromDiffEntry ( rsp . getValue ( ) )
241+ } )
241242 }
242243 } )
243244 )
@@ -255,7 +256,11 @@ class RemoteHyperdrive {
255256 const call = this . _client . createReadStream ( req , toMetadata ( { token : this . token } ) )
256257 return pumpify (
257258 call ,
258- map . obj ( rsp => Buffer . from ( rsp . getChunk ( ) ) )
259+ new Transform ( {
260+ transform ( rsp , cb ) {
261+ return cb ( null , Buffer . from ( rsp . getChunk ( ) ) )
262+ }
263+ } )
259264 )
260265 }
261266
You can’t perform that action at this time.
0 commit comments