StaticisType guard to check if a value is an authentic WeakCache instance
Clears all entries from the cache and unregisters all active finalizers.
Deletes a key from the cache and unregisters its finalizer.
The cache key to delete
True if an entry existed and was deleted, false otherwise
Checks whether the cache contains a non-collected value for the given key.
The cache key to check
True if the key exists and its value has not been collected
WeakCache
Map-like cache holding values weakly via
WeakRefand auto-pruning collected entries usingFinalizerwithout memory leaks.Keys must be primitive (
string | number | symbol) to ensure the key does not create a strong reference cycle with the cached value.