From: Jérôme Benoit Date: Fri, 1 Oct 2021 18:50:11 +0000 (+0200) Subject: Flag some attributes readonly X-Git-Tag: v1.1.21~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9e23580d87c4e356f85a41eff450693f7d7738dd;p=e-mobility-charging-stations-simulator.git Flag some attributes readonly Signed-off-by: Jérôme Benoit --- diff --git a/package-lock.json b/package-lock.json index 4b0ace88..a824b10d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17721,9 +17721,9 @@ } }, "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" diff --git a/package.json b/package.json index 491ddee3..458f3c46 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "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", diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index 6913853b..f444018a 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -11,8 +11,8 @@ import logger from '../utils/Logger'; export default class AutomaticTransactionGenerator { public started: boolean; - private chargingStation: ChargingStation; - private connectorsStatus: Map; + private readonly chargingStation: ChargingStation; + private readonly connectorsStatus: Map; constructor(chargingStation: ChargingStation) { this.chargingStation = chargingStation; diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 511a4d7a..809c623a 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -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; diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index a01beda2..b7fff801 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -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; + public readonly connectors: Map; public configuration!: ChargingStationConfiguration; public wsConnection!: WebSocket; - public requests: Map; + public readonly requests: Map; 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; diff --git a/src/performance/PerformanceStatistics.ts b/src/performance/PerformanceStatistics.ts index 70f9bafd..56f8c042 100644 --- a/src/performance/PerformanceStatistics.ts +++ b/src/performance/PerformanceStatistics.ts @@ -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) { diff --git a/src/performance/storage/MongoDBStorage.ts b/src/performance/storage/MongoDBStorage.ts index 5a378381..b82feb7f 100644 --- a/src/performance/storage/MongoDBStorage.ts +++ b/src/performance/storage/MongoDBStorage.ts @@ -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) {