An implementation of a LinkedList
that has a set size and adds new nodes or moves existing nodes to the front of the list while drpping old nodes. It is useful for caching data that will probably be needed more than once somewhat consecutively.
new LeastRecentlyUsed<Value, Key?>(size: number);
The number of items in the cache.
Update the limit of an existing cache.
Get the element for a particular node and move it to the head of the cache.
Adds an element to the head of the cache, removes duplicate.
Updates a value in the cache in-place if found, otherwise adds to the head of the cache.
Removes an element from the cache.
Removes and returns the head of the cache.
Returns true if element exists in cache.
Return an array of each element in the cache.
Remove all nodes in cache.