Skip to content

Commit a17dbed

Browse files
committed
Declare FS encoding
1 parent f5710dd commit a17dbed

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/home.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export async function shutdownAllServers() {
233233
function loadState() {
234234
try {
235235
return JSON.parse(
236-
fs.readFileSync(path.join(getCoreDir(), 'homestate.json'), 'utf8')
236+
fs.readFileSync(path.join(getCoreDir(), 'homestate.json'), { encoding: 'utf-8' })
237237
);
238238
} catch (err) {}
239239
}

src/misc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function sleep(ms) {
1818
export async function loadJSON(filePath) {
1919
try {
2020
await fs.access(filePath);
21-
return JSON.parse(await fs.readFile(filePath, 'utf8'));
21+
return JSON.parse(await fs.readFile(filePath, { encoding: 'utf-8' }));
2222
} catch (err) {
2323
console.error(err);
2424
return null;

src/project/config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ export default class ProjectConfig {
4949
this._parsed.push(path);
5050
let section = null;
5151
let option = null;
52-
for (let line of (await fs.readFile(path, 'utf-8')).split(this.reLines)) {
52+
for (let line of (await fs.readFile(path, { encoding: 'utf-8' })).split(
53+
this.reLines
54+
)) {
5355
// Remove comments
5456
line = line.replace(this.reComment, '');
5557
if (!line) {

0 commit comments

Comments
 (0)