Skip to content

Commit c988ca2

Browse files
committed
fix: clarify entries() and values() ordering in JSDoc
1 parent 406a3d3 commit c988ca2

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/lru.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,13 @@ export class LRU {
107107

108108
/**
109109
* Returns an array of [key, value] pairs for the specified keys.
110-
* Order follows LRU order (least to most recently used).
110+
* When no keys provided, returns all entries in LRU order.
111+
* When keys provided, order matches the input array.
111112
*
112113
* @method entries
113114
* @memberof LRU
114115
* @param {string[]} [keys=this.keys()] - Array of keys to get entries for. Defaults to all keys.
115-
* @returns {Array<Array<*>>} Array of [key, value] pairs in LRU order.
116+
* @returns {Array<Array<*>>} Array of [key, value] pairs.
116117
* @example
117118
* cache.set('a', 1).set('b', 2);
118119
* console.log(cache.entries()); // [['a', 1], ['b', 2]]
@@ -427,12 +428,13 @@ export class LRU {
427428

428429
/**
429430
* Returns an array of all values in the cache for the specified keys.
430-
* Order follows LRU order (least to most recently used).
431+
* When no keys provided, returns all values in LRU order.
432+
* When keys provided, order matches the input array.
431433
*
432434
* @method values
433435
* @memberof LRU
434436
* @param {string[]} [keys=this.keys()] - Array of keys to get values for. Defaults to all keys.
435-
* @returns {Array<*>} Array of values corresponding to the keys in LRU order.
437+
* @returns {Array<*>} Array of values corresponding to the keys.
436438
* @example
437439
* cache.set('a', 1).set('b', 2);
438440
* console.log(cache.values()); // [1, 2]

0 commit comments

Comments
 (0)