The implementation of this LRU cache does not enforce the documented behavior:
maxSize
Required
Type: number
The maximum number of items before evicting the least recently used items.
Running this code snippet produces true
in the console:
const m = new QuickLRU({
maxSize: 2
});
m.set("key1", "value1");
m.set("key2", "value2");
m.set("key3", "value3");
console.log(m.has("key1"));
The cache should only be able to store 2 items and when adding a total of 3 items to the list, the first key-value pair (key1
-value1
) should be evicted. However, from the result of executing the code, you can see that key1
is still in the cache.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too