Method for peeking at the newest cache entry key

This commit is contained in:
Tim Schaub
2017-10-07 10:04:19 -06:00
parent 10af59bfce
commit 177156c293
2 changed files with 33 additions and 0 deletions

View File

@@ -196,6 +196,15 @@ ol.structs.LRUCache.prototype.peekLastKey = function() {
};
/**
* Get the key of the newest item in the cache. Throws if the cache is empty.
* @return {string} The newest key.
*/
ol.structs.LRUCache.prototype.peekFirstKey = function() {
return this.newest_.key_;
};
/**
* @return {T} value Value.
*/