Cleanup fs operations encoding
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 12 Sep 2021 19:07:58 +0000 (21:07 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 12 Sep 2021 19:07:58 +0000 (21:07 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/performance/storage/JSONFileStorage.ts

index 34e254746e7bf14239d210ddafcd69222d535aa3..c91a14d5756c90f8b69137d391d64348c6c78a8d 100644 (file)
@@ -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);
           }