cache/cache
Documentation
- source: cache/cache.ts
Overview
Classes
Cache
contains()
Checks if the cache contains a value for the specified key.
tsstatic contains(key: string): boolean;
Parameter Type Description keystringThe key to check. Returns
- Type:
boolean- Description: True if the key exists in the cache, false otherwise.
get()
Retrieves the value associated with the specified key from the cache.
tsstatic get(key: any): any;
Parameter Type Description keyanyThe key to retrieve. Returns
- Type:
any- Description: The cached value, or `undefined` if the key is not found.
set()
Stores a value in the cache under the specified key. Note: The duration/time-to-live (TTL) is typically configured server-side.
tsstatic set(key: string, data: any): void;
Parameter Type Description keystringThe key to store the data under. dataanyThe data to store. Returns
- Type:
void- Description:
delete()
Removes the key and its associated value from the cache.
tsstatic delete(key: string): void;
Parameter Type Description keystringThe key to delete. Returns
- Type:
void- Description:
clear()
Clears all entries from the cache.
tsstatic clear(): void;Returns
- Type:
void- Description:
