@@ -812,7 +812,7 @@ export namespace LRUCache {
812812 * Changing any of these will alter the defaults for subsequent method calls,
813813 * but is otherwise safe.
814814 */
815- export class LRUCache < K extends { } , V extends { } , FC = unknown > {
815+ export class LRUCache < K extends { } , V extends { } , FC = unknown > implements Map < K , V > {
816816 // properties coming in from the options of these, only max and maxSize
817817 // really *need* to be protected. The rest can be modified, as they just
818818 // set defaults for various methods.
@@ -1392,7 +1392,7 @@ export class LRUCache<K extends {}, V extends {}, FC = unknown> {
13921392 this . #keyList[ i ] !== undefined &&
13931393 ! this . #isBackgroundFetch( this . #valList[ i ] )
13941394 ) {
1395- yield [ this . #keyList[ i ] , this . #valList[ i ] ]
1395+ yield [ this . #keyList[ i ] , this . #valList[ i ] ] as [ K , V ]
13961396 }
13971397 }
13981398 }
@@ -1460,7 +1460,7 @@ export class LRUCache<K extends {}, V extends {}, FC = unknown> {
14601460 v !== undefined &&
14611461 ! this . #isBackgroundFetch( this . #valList[ i ] )
14621462 ) {
1463- yield this . #valList[ i ]
1463+ yield this . #valList[ i ] as V
14641464 }
14651465 }
14661466 }
@@ -1491,6 +1491,12 @@ export class LRUCache<K extends {}, V extends {}, FC = unknown> {
14911491 return this . entries ( )
14921492 }
14931493
1494+ /**
1495+ * A String value that is used in the creation of the default string description of an object.
1496+ * Called by the built-in method Object.prototype.toString.
1497+ */
1498+ [ Symbol . toStringTag ] = 'LRUCache'
1499+
14941500 /**
14951501 * Find a value for which the supplied fn method returns a truthy value,
14961502 * similar to Array.find(). fn is called as fn(value, key, cache).
0 commit comments