From 247f55f4b67f4ed161ed6b2d8f076c65b52a7038 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 12 Sep 2021 21:07:58 +0200 Subject: [PATCH] Cleanup fs operations encoding MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/performance/storage/JSONFileStorage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); } -- 2.34.1