File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -92,11 +92,8 @@ class FileProxyPromise extends FileProxy {
9292/** Class supporting multi-range requests */
9393class FileProxyMultiple extends FileProxyPromise {
9494
95- /** example of reading several segments at once */
95+ /** example of reading several segments at once, always return array */
9696 async readBuffers ( places ) {
97- if ( places . length === 2 )
98- return this . readBuffer ( places [ 0 ] , places [ 1 ] ) ;
99-
10097 if ( ! this . fd )
10198 return Promise . resolve ( [ ] ) ;
10299
Original file line number Diff line number Diff line change @@ -3903,7 +3903,9 @@ class TProxyFile extends TFile {
39033903 return Promise . reject ( Error ( `File is not opened ${ this . fFileName } ` ) ) ;
39043904
39053905 if ( isFunc ( this . proxy . readBuffers ) )
3906- return this . proxy . readBuffers ( place ) ;
3906+ return this . proxy . readBuffers ( place ) . then ( arr => {
3907+ return arr ?. length === 1 ? arr [ 0 ] : arr ;
3908+ } ) ;
39073909
39083910 if ( place . length === 2 )
39093911 return this . proxy . readBuffer ( place [ 0 ] , place [ 1 ] ) ;
You can’t perform that action at this time.
0 commit comments