Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Boberg <[email protected]>
  • Loading branch information
axelboberg committed Mar 24, 2024
1 parent 7eb8f29 commit e86505c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/classes/Cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const InvalidArgumentError = require('../error/InvalidArgumentError')
*/
class Cache {
/**
* @private
* A map containing the cache's index,
* mapping keys to cache entries
*
Expand All @@ -24,13 +25,19 @@ class Cache {
* @type { Map.<String, Entry> }
*/
#index = new Map()

/**
* @private
* @type { Number }
*/
#maxEntries

constructor (maxEntries = 10) {
this.#maxEntries = maxEntries
}

/**
* @private
* Prepare the cache index for insertion,
* this will make sure that the index
* stays within the set max size
Expand Down

0 comments on commit e86505c

Please sign in to comment.