mirror of
https://github.com/unraid/api.git
synced 2026-05-13 02:59:17 -05:00
fix: use utf8 not utf-8
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user