Skip to content

Commit 0f5ff1e

Browse files
committed
fix(types): make items property return Record<any, LRUItem<T> | undefined>
This correctly reflects that items[key] returns undefined for missing keys,
1 parent be91f2c commit 0f5ff1e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

types/lru.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class LRU<T = any> {
5353
/** Pointer to the least recently used item (first to be evicted) */
5454
first: LRUItem<T> | null;
5555
/** Hash map for O(1) key-based access to cache nodes */
56-
items: Record<any, LRUItem<T>>;
56+
items: Record<any, LRUItem<T> | undefined>;
5757
/** Pointer to the most recently used item */
5858
last: LRUItem<T> | null;
5959
/** Maximum number of items to store (0 = unlimited) */

0 commit comments

Comments
 (0)