From: Jérôme Benoit Date: Sun, 12 Sep 2021 19:07:58 +0000 (+0200) Subject: Cleanup fs operations encoding X-Git-Tag: v1.0.60~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=247f55f4b67f4ed161ed6b2d8f076c65b52a7038;p=e-mobility-charging-stations-simulator.git Cleanup fs operations encoding Signed-off-by: Jérôme Benoit --- diff --git a/src/performance/storage/JSONFileStorage.ts b/src/performance/storage/JSONFileStorage.ts index 34e25474..c91a14d5 100644 --- a/src/performance/storage/JSONFileStorage.ts +++ b/src/performance/storage/JSONFileStorage.ts @@ -16,13 +16,13 @@ export class JSONFileStorage extends Storage { public storePerformanceStatistics(performanceStatistics: Statistics): void { this.checkPerformanceRecordsFile(); - fs.readFile(this.dbName, 'utf-8', (error, data) => { + fs.readFile(this.dbName, 'utf8', (error, data) => { if (error) { FileUtils.handleFileException(this.logPrefix, Constants.PERFORMANCE_RECORDS_FILETYPE, this.dbName, error); } else { const performanceRecords: Statistics[] = data ? JSON.parse(data) as Statistics[] : []; performanceRecords.push(performanceStatistics); - fs.writeFile(this.dbName, JSON.stringify(performanceRecords, null, 2), 'utf-8', (err) => { + fs.writeFile(this.dbName, JSON.stringify(performanceRecords, null, 2), 'utf8', (err) => { if (err) { FileUtils.handleFileException(this.logPrefix, Constants.PERFORMANCE_RECORDS_FILETYPE, this.dbName, err); }