diff --git a/cli/asc.js b/cli/asc.js index fda8512943..ef26b5c99e 100644 --- a/cli/asc.js +++ b/cli/asc.js @@ -945,7 +945,7 @@ exports.main = function main(argv, options, callback) { let text; stats.readCount++; stats.readTime += measure(() => { - text = fs.readFileSync(name, { encoding: "utf8" }); + text = fs.readFileSync(name, "utf8"); }); return text; } catch (e) { @@ -961,10 +961,7 @@ exports.main = function main(argv, options, callback) { filename = path.basename(filename); const outputFilePath = path.join(dirPath, filename); if (!fs.existsSync(dirPath)) mkdirp(dirPath); - fs.writeFileSync( - outputFilePath, contents, - typeof contents === "string" ? { encoding: "utf8" } : void 0 - ); + fs.writeFileSync(outputFilePath, contents); }); return true; } catch (e) { @@ -992,11 +989,7 @@ exports.main = function main(argv, options, callback) { writeStdout.used = true; } stats.writeTime += measure(() => { - if (typeof contents === "string") { - stdout.write(contents, { encoding: "utf8" }); - } else { - stdout.write(contents); - } + stdout.write(contents); }); } };