MCPcopy
hub / github.com/nanbingxyz/5ire / get

Function get

src/utils/cache.ts:30–43  ·  view source on GitHub ↗

* Retrieves a value from the cache if it exists and hasn't expired * @param {string} key - The cache key to retrieve * @returns {any|null} The cached value or null if not found or expired

(key: string)

Source from the content-addressed store, hash-verified

28 * @returns {any|null} The cached value or null if not found or expired
29 */
30 get(key: string) {
31 const itemStr = localStorage.getItem(key);
32 if (!itemStr) {
33 return null;
34 }
35
36 const item = JSON.parse(itemStr);
37 if (Date.now() > item.expiration) {
38 localStorage.removeItem(key);
39 return null;
40 }
41
42 return item.value;
43 },
44
45 /**
46 * Removes a specific item from the cache

Callers 13

usePromptStore.tsFile · 0.50
useChatStore.tsFile · 0.50
loadBookmarksFunction · 0.50
loadFavoritesFunction · 0.50
useAuthStore.tsFile · 0.50
useMCPStore.tsFile · 0.50

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected