From 0e89dd9a3274a9c5b1f0faf651525c43801e6249 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 4 Jun 2022 21:57:54 +0200 Subject: [PATCH] Remove any usage in the charging station cache MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStationCache.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/charging-station/ChargingStationCache.ts b/src/charging-station/ChargingStationCache.ts index 682e2d9c..b4e9b9d0 100644 --- a/src/charging-station/ChargingStationCache.ts +++ b/src/charging-station/ChargingStationCache.ts @@ -8,12 +8,14 @@ enum CacheType { CHARGING_STATION_CONFIGURATION = 'chargingStationConfiguration', } +type CacheableType = ChargingStationTemplate | ChargingStationConfiguration; + export class ChargingStationCache { private static instance: ChargingStationCache | null = null; - private readonly lruCache: LRUCache; + private readonly lruCache: LRUCache; private constructor() { - this.lruCache = new LRUCache(1000); + this.lruCache = new LRUCache(1000); } public static getInstance(): ChargingStationCache { @@ -79,11 +81,11 @@ export class ChargingStationCache { return this.lruCache.has(key); } - private get(key: string): any { + private get(key: string): CacheableType { return this.lruCache.get(key); } - private set(key: string, value: any): void { + private set(key: string, value: CacheableType): void { this.lruCache.set(key, value); } -- 2.34.1