Updated cache
All checks were successful
Build / Build NPM Project (push) Successful in 26s
Build / Tag Version (push) Successful in 6s

This commit is contained in:
Zakary Timson 2024-09-28 14:41:43 -04:00
parent 811d797e1b
commit e6636d373b
2 changed files with 10 additions and 1 deletions

View File

@ -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",

View File

@ -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
* *