Updated cache
This commit is contained in:
parent
811d797e1b
commit
e6636d373b
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ztimson/utils",
|
"name": "@ztimson/utils",
|
||||||
"version": "0.16.5",
|
"version": "0.16.6",
|
||||||
"description": "Utility library",
|
"description": "Utility library",
|
||||||
"author": "Zak Timson",
|
"author": "Zak Timson",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@ -83,6 +83,15 @@ export class Cache<K, T> {
|
|||||||
return <[K, T][]>Object.entries(this.store);
|
return <[K, T][]>Object.entries(this.store);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get item from the cache
|
||||||
|
* @param {K} key Key to lookup
|
||||||
|
* @return {T} Cached item
|
||||||
|
*/
|
||||||
|
get(key: K): T {
|
||||||
|
return this.store[key];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of cached keys
|
* Get a list of cached keys
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user