repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(deps): apply updates
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
SharedLRUCache.ts
diff --git
a/src/charging-station/SharedLRUCache.ts
b/src/charging-station/SharedLRUCache.ts
index d2d638690fdb755ead4c5f5b68842cf22ba53b4c..bb1c0c07e3749e99b6ee76a4d8e3486696f6eac4 100644
(file)
--- a/
src/charging-station/SharedLRUCache.ts
+++ b/
src/charging-station/SharedLRUCache.ts
@@
-1,22
+1,22
@@
-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';
import { Bootstrap } from './internal';
import type { ChargingStationConfiguration, ChargingStationTemplate } from '../types';
-import { Utils } from '../utils
/Utils
';
+import { Utils } from '../utils';
enum CacheType {
enum CacheType {
-
CHARGING_STATION_TEMPLATE
= 'chargingStationTemplate',
-
CHARGING_STATION_CONFIGURATION
= 'chargingStationConfiguration',
+
chargingStationTemplate
= 'chargingStationTemplate',
+
chargingStationConfiguration
= 'chargingStationConfiguration',
}
}
-type Cache
abl
eType = ChargingStationTemplate | ChargingStationConfiguration;
+type Cache
Valu
eType = ChargingStationTemplate | ChargingStationConfiguration;
export class SharedLRUCache {
private static instance: SharedLRUCache | null = null;
export class SharedLRUCache {
private static instance: SharedLRUCache | null = null;
- private readonly lruCache: LRUCache<string, Cache
abl
eType>;
+ private readonly lruCache: LRUCache<string, Cache
Valu
eType>;
private constructor() {
private constructor() {
- this.lruCache = new LRUCache<string, Cache
abl
eType>(
+ this.lruCache = new LRUCache<string, Cache
Valu
eType>(
Bootstrap.getInstance().numberOfChargingStationTemplates +
Bootstrap.getInstance().numberOfChargingStations
);
Bootstrap.getInstance().numberOfChargingStationTemplates +
Bootstrap.getInstance().numberOfChargingStations
);
@@
-82,22
+82,22
@@
export class SharedLRUCache {
}
private getChargingStationConfigurationKey(hash: string): string {
}
private getChargingStationConfigurationKey(hash: string): string {
- return `${CacheType.
CHARGING_STATION_CONFIGURATION
}${hash}`;
+ return `${CacheType.
chargingStationConfiguration
}${hash}`;
}
private getChargingStationTemplateKey(hash: string): string {
}
private getChargingStationTemplateKey(hash: string): string {
- return `${CacheType.
CHARGING_STATION_TEMPLATE
}${hash}`;
+ return `${CacheType.
chargingStationTemplate
}${hash}`;
}
private has(key: string): boolean {
return this.lruCache.has(key);
}
}
private has(key: string): boolean {
return this.lruCache.has(key);
}
- private get(key: string): Cache
abl
eType | undefined {
+ private get(key: string): Cache
Valu
eType | undefined {
return this.lruCache.get(key);
}
return this.lruCache.get(key);
}
- private set(key: string, value: Cache
abl
eType): void {
+ private set(key: string, value: Cache
Valu
eType): void {
this.lruCache.set(key, value);
}
this.lruCache.set(key, value);
}