Type Parameters
- K extends string | number
- V
Constructors
constructor
- new LruMap<K, V>(capacity, forLong?): LruMap<K, V>
Type Parameters
- K extends string | number
- V
Parameters
- capacity: number
- forLong: boolean = false
Methods
clear
- clear(): void
Returns void
delete
- delete(key): void
Returns void
get
- get(key): undefined | V
Returns undefined | V
has
- has(key): boolean
Returns boolean
set
- set(key, value): void
Returns void
Simple class implementing LRU-like behaviour for a Map
Can be used to handle local cache of something
Uses two-way linked list internally to keep track of insertion/access order