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 b957895 commit 03d02d7Copy full SHA for 03d02d7
lib/internal/fs/promises.js
@@ -188,11 +188,8 @@ async function readFileHandle(filehandle, options) {
188
} while (!endOfFile);
189
190
const result = Buffer.concat(chunks);
191
- if (options.encoding) {
192
- return result.toString(options.encoding);
193
- } else {
194
- return result;
195
- }
+
+ return options.encoding ? result.toString(options.encoding) : result;
196
}
197
198
// All of the functions are defined as async in order to ensure that errors
0 commit comments