X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FSharedLRUCache.ts;h=bb1c0c07e3749e99b6ee76a4d8e3486696f6eac4;hb=12909bc982b50270d13fb6cea213c9f6296bbdf6;hp=3ee8cd7f7fa3a054ea5ca0410ee802d9702ad8f1;hpb=10922dcc8705fe73e4cb6b59ee0dbdc9003ecde7;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/SharedLRUCache.ts b/src/charging-station/SharedLRUCache.ts index 3ee8cd7f..bb1c0c07 100644 --- a/src/charging-station/SharedLRUCache.ts +++ b/src/charging-station/SharedLRUCache.ts @@ -1,4 +1,4 @@ -import LRUCache from 'mnemonist/lru-map-with-delete'; +import LRUCache from 'mnemonist/lru-map-with-delete.js'; import { Bootstrap } from './internal'; import type { ChargingStationConfiguration, ChargingStationTemplate } from '../types'; @@ -9,14 +9,14 @@ enum CacheType { chargingStationConfiguration = 'chargingStationConfiguration', } -type CacheableType = ChargingStationTemplate | ChargingStationConfiguration; +type CacheValueType = ChargingStationTemplate | ChargingStationConfiguration; export class SharedLRUCache { private static instance: SharedLRUCache | null = null; - private readonly lruCache: LRUCache; + private readonly lruCache: LRUCache; private constructor() { - this.lruCache = new LRUCache( + this.lruCache = new LRUCache( Bootstrap.getInstance().numberOfChargingStationTemplates + Bootstrap.getInstance().numberOfChargingStations ); @@ -93,11 +93,11 @@ export class SharedLRUCache { return this.lruCache.has(key); } - private get(key: string): CacheableType | undefined { + private get(key: string): CacheValueType | undefined { return this.lruCache.get(key); } - private set(key: string, value: CacheableType): void { + private set(key: string, value: CacheValueType): void { this.lruCache.set(key, value); }