Cache<K, V>
Generic cache interface for type-safe cache operations.
Sinceβ
2.0.0
Type Parametersβ
K: Kβ
The key type.
V: Vβ
The value type.
Propertiesβ
size: numberβ
The number of entries in the cache.
Methodsβ
get()β
Retrieves a value from the cache, or undefined if not found.
key:
K
Returns:V | undefined
set()β
Stores a value in the cache.
key:
K
value:V
Returns:void
has()β
Checks if a key exists in the cache.
key:
K
Returns:boolean
delete()β
Removes a key from the cache.
key:
K
Returns:boolean
clear()β
Clears all entries from the cache.
Returnsβ
void