We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6264ac1 commit e582832Copy full SHA for e582832
lib/internal/fs/promises.js
@@ -311,7 +311,7 @@ async function readFileHandle(filehandle, options) {
311
chunks.push(buffer.slice(0, bytesRead));
312
} while (!endOfFile);
313
314
- const result = Buffer.concat(chunks);
+ const result = chunks.length === 1 ? chunks[0] : Buffer.concat(chunks);
315
316
return options.encoding ? result.toString(options.encoding) : result;
317
}
0 commit comments