fix: use utf8 not utf-8

This commit is contained in:
Alexis Tyler
2021-03-05 14:55:44 +10:30
parent 58abb7e3cf
commit e2aecd1191
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ export const getMachineId = async (): Promise<string> => {
}
if (!machineId) {
machineId = await fs.promises.readFile(path, 'utf-8').then(machineId => machineId.split('\n')[0].trim());
machineId = await fs.promises.readFile(path, 'utf8').then(machineId => machineId.split('\n')[0].trim());
}
return machineId;
+1 -1
View File
@@ -90,7 +90,7 @@ const fixObjectArrays = (object: Record<string, any>) => {
export const parseConfig = <T>(options: Options): T => {
const { file, type } = options;
const filePath = getPath(options.filePath);
const fileContents = filePath ? fs.readFileSync(filePath, 'utf-8').toString() : file!;
const fileContents = filePath ? fs.readFileSync(filePath, 'utf8').toString() : file!;
const fileType = type || filePath.split('.').splice(-1)[0];
// Only allow ini and cfg files.