File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ function newWritableStreamFromStreamWritable(streamWritable) {
217217 start ( c ) { controller = c ; } ,
218218
219219 write ( chunk ) {
220- if ( isArrayBuffer ( chunk ) ) {
220+ if ( ! streamWritable . writableObjectMode && isArrayBuffer ( chunk ) ) {
221221 chunk = new Uint8Array ( chunk ) ;
222222 }
223223 if ( streamWritable . writableNeedDrain || ! streamWritable . write ( chunk ) ) {
Original file line number Diff line number Diff line change @@ -43,16 +43,7 @@ async function testCompressionRoundTripWithArrayBuffer() {
4343 await csWriter . write ( input ) ;
4444 csWriter . close ( ) ;
4545
46- const compressed = [ ] ;
47- let done = false ;
48- while ( ! done ) {
49- const { value, done : d } = await csReader . read ( ) ;
50- if ( value ) compressed . push ( value ) ;
51- done = d ;
52- }
53-
54- for ( const chunk of compressed ) await dsWriter . write ( chunk ) ;
55- dsWriter . close ( ) ;
46+ await cs . readable . pipeTo ( ds . writable ) ;
5647
5748 const out = [ ] ;
5849 done = false ;
You can’t perform that action at this time.
0 commit comments