@@ -519,8 +519,8 @@ async function readFileHandle(filehandle, options) {
519519
520520 let size = 0 ;
521521 let length = 0 ;
522- if ( ( statFields [ 1 /* mode */ ] & S_IFMT ) === S_IFREG ) {
523- size = statFields [ 8 /* size */ ] ;
522+ if ( ( statFields [ 1 /* mode */ ] & S_IFMT ) === S_IFREG ) {
523+ size = statFields [ 8 /* size */ ] ;
524524 length = encoding ? MathMin ( size , kReadFileBufferLength ) : size ;
525525 }
526526 if ( length === 0 ) {
@@ -549,7 +549,9 @@ async function readFileHandle(filehandle, options) {
549549 ) ) ?? 0 ;
550550 totalRead += bytesRead ;
551551
552- if ( bytesRead === 0 || totalRead === size || ( bytesRead !== buffer . length && ! chunkedRead && ! noSize ) ) {
552+ if ( bytesRead === 0 ||
553+ totalRead === size ||
554+ ( bytesRead !== buffer . length && ! chunkedRead && ! noSize ) ) {
553555 const singleRead = bytesRead === totalRead ;
554556
555557 const bytesToCheck = chunkedRead ? totalRead : bytesRead ;
@@ -573,7 +575,9 @@ async function readFileHandle(filehandle, options) {
573575 return result ;
574576 }
575577
576- const readBuffer = bytesRead !== buffer . length ? buffer . subarray ( 0 , bytesRead ) : buffer ;
578+ const readBuffer = bytesRead !== buffer . length ?
579+ buffer . subarray ( 0 , bytesRead ) :
580+ buffer ;
577581
578582 if ( encoding ) {
579583 result += decoder . write ( readBuffer ) ;
@@ -584,7 +588,6 @@ async function readFileHandle(filehandle, options) {
584588 // Unknown file size requires chunks.
585589 ArrayPrototypePush ( buffers , readBuffer ) ;
586590
587- // Create a new buffer (continue for large files)
588591 buffer = Buffer . allocUnsafeSlow ( kReadFileUnknownBufferLength ) ;
589592 }
590593 }
0 commit comments