Flag some attributes readonly
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 1 Oct 2021 18:50:11 +0000 (20:50 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 1 Oct 2021 18:50:11 +0000 (20:50 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
package-lock.json
package.json
src/charging-station/AutomaticTransactionGenerator.ts
src/charging-station/Bootstrap.ts
src/charging-station/ChargingStation.ts
src/performance/PerformanceStatistics.ts
src/performance/storage/MongoDBStorage.ts

index 4b0ace88372adca57d1617a96ed2b0d542eeb7c4..a824b10dd2e19f0bd6aa31605ea099793183e887 100644 (file)
       }
     },
     "rollup": {
-      "version": "2.57.0",
-      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.57.0.tgz",
-      "integrity": "sha512-bKQIh1rWKofRee6mv8SrF2HdP6pea5QkwBZSMImJysFj39gQuiV8MEPBjXOCpzk3wSYp63M2v2wkWBmFC8O/rg==",
+      "version": "2.58.0",
+      "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.58.0.tgz",
+      "integrity": "sha512-NOXpusKnaRpbS7ZVSzcEXqxcLDOagN6iFS8p45RkoiMqPHDLwJm758UF05KlMoCRbLBTZsPOIa887gZJ1AiXvw==",
       "dev": true,
       "requires": {
         "fsevents": "~2.3.2"
index 491ddee3111ebcdc7877dd1482ba79c110572a38..458f3c468a4f75f93e0083c07ebffec829536104 100644 (file)
     "nyc": "^15.1.0",
     "release-it": "^14.11.6",
     "robohydra": "^0.6.9",
-    "rollup": "^2.57.0",
+    "rollup": "^2.58.0",
     "rollup-plugin-analyzer": "^4.0.0",
     "rollup-plugin-copy": "^3.4.0",
     "rollup-plugin-delete": "^2.0.0",
index 6913853b2911b8354784d9799f9d377c8356aa2d..f444018a2e36418254fe927e553d1eab7ce31372 100644 (file)
@@ -11,8 +11,8 @@ import logger from '../utils/Logger';
 
 export default class AutomaticTransactionGenerator {
   public started: boolean;
-  private chargingStation: ChargingStation;
-  private connectorsStatus: Map<number, Status>;
+  private readonly chargingStation: ChargingStation;
+  private readonly connectorsStatus: Map<number, Status>;
 
   constructor(chargingStation: ChargingStation) {
     this.chargingStation = chargingStation;
index 511a4d7a452afa6cd651bc3deae8f8426af830b9..809c623ab51062db24812fefac5f780be76e63ab 100644 (file)
@@ -18,9 +18,9 @@ export default class Bootstrap {
   private static workerImplementation: WorkerAbstract | null = null;
   private static storage: Storage;
   private static numberOfChargingStations: number;
-  private version: string = version;
+  private readonly version: string = version;
   private started: boolean;
-  private workerScript: string;
+  private readonly workerScript: string;
 
   private constructor() {
     this.started = false;
index a01beda2acf802ba794c818277b71abc8e408f0b..b7fff8015274c050d9cff4caba5c98700aad203c 100644 (file)
@@ -37,22 +37,22 @@ import logger from '../utils/Logger';
 import path from 'path';
 
 export default class ChargingStation {
-  public stationTemplateFile: string;
+  public readonly stationTemplateFile: string;
   public authorizedTags: string[];
   public stationInfo!: ChargingStationInfo;
-  public connectors: Map<number, ConnectorStatus>;
+  public readonly connectors: Map<number, ConnectorStatus>;
   public configuration!: ChargingStationConfiguration;
   public wsConnection!: WebSocket;
-  public requests: Map<string, CachedRequest>;
+  public readonly requests: Map<string, CachedRequest>;
   public performanceStatistics!: PerformanceStatistics;
   public heartbeatSetInterval!: NodeJS.Timeout;
   public ocppRequestService!: OCPPRequestService;
-  private index: number;
+  private readonly index: number;
   private bootNotificationRequest!: BootNotificationRequest;
   private bootNotificationResponse!: BootNotificationResponse | null;
   private connectorsConfigurationHash!: string;
   private ocppIncomingRequestService!: OCPPIncomingRequestService;
-  private messageQueue: string[];
+  private readonly messageQueue: string[];
   private wsConnectionUrl!: URL;
   private wsConnectionRestarted: boolean;
   private stopped: boolean;
index 70f9bafdbaedcc704c37eb5ae9d8447c68d489f8..56f8c0429e4ec532a4ee40f4bfe4ce94b761c967 100644 (file)
@@ -14,9 +14,9 @@ import logger from '../utils/Logger';
 import { parentPort } from 'worker_threads';
 
 export default class PerformanceStatistics {
-  private objId: string;
+  private readonly objId: string;
   private performanceObserver: PerformanceObserver;
-  private statistics: Statistics;
+  private readonly statistics: Statistics;
   private displayInterval: NodeJS.Timeout;
 
   public constructor(objId: string, URI: URL) {
index 5a3783818cba77bcb16bf25e622ae81015f77fe8..b82feb7f7dda123bc20aedffa783fe054e7a1b15 100644 (file)
@@ -7,7 +7,7 @@ import { Storage } from './Storage';
 import { StorageType } from '../../types/Storage';
 
 export class MongoDBStorage extends Storage {
-  private client: MongoClient | null;
+  private readonly client: MongoClient | null;
   private connected: boolean;
 
   constructor(storageURI: string, logPrefix: string) {