From e6636d373b9a22d1835406063e1bca42aaaa6440 Mon Sep 17 00:00:00 2001 From: ztimson Date: Sat, 28 Sep 2024 14:41:43 -0400 Subject: [PATCH] Updated cache --- package.json | 2 +- src/cache.ts | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b3a0d6e..5317c09 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/utils", - "version": "0.16.5", + "version": "0.16.6", "description": "Utility library", "author": "Zak Timson", "license": "MIT", diff --git a/src/cache.ts b/src/cache.ts index f162f16..6d8dcd3 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -83,6 +83,15 @@ export class Cache { 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 *