File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export class FirmwareService {
2929 }
3030
3131 private async unzipStreamToVariable ( stream : ReadableStream < Uint8Array > ) : Promise < { [ filename : string ] : Uint8Array } > {
32+ print ( "In unzipStreamToVariable method." ) ;
3233 const reader = stream . getReader ( ) ;
3334 let chunks = [ ] ;
3435 while ( true ) {
@@ -38,11 +39,14 @@ export class FirmwareService {
3839 }
3940 chunks . push ( value ) ;
4041 }
42+
4143 const allChunks = new Uint8Array ( chunks . flatMap ( chunk => [ ...chunk ] ) ) ;
44+ console . log ( 'All chunks:' , allChunks ) ;
4245 const { entries } = await unzip ( allChunks ) ;
4346
4447 const unzippedData : { [ filename : string ] : Uint8Array } = { } ;
4548 for ( const entry of Object . values ( entries ) as { name : string ; arrayBuffer : ( ) => Promise < ArrayBuffer > } [ ] ) {
49+ console . log ( 'Entry:' , entry . name ) ;
4650 const arrayBuffer = await entry . arrayBuffer ( ) ;
4751 unzippedData [ entry . name ] = new Uint8Array ( arrayBuffer ) ;
4852 }
You can’t perform that action at this time.
0 commit comments