MCPcopy Create free account
hub / github.com/ethanniser/the-beth-stack / get

Method get

packages/beth-stack/src/cache/new-persist.ts:107–118  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

105 );
106 }
107 public get(key: string) {
108 const result = this.db
109 .query("SELECT value FROM cache WHERE key = ?")
110 .get(key) as { value: string } | undefined;
111 if (result) {
112 return JSON.parse(result.value);
113 } else {
114 throw new Error(
115 `No entry found in json cache when one was expected: ${key}`,
116 );
117 }
118 }
119 public set(key: string, value: any) {
120 this.db
121 .query(

Callers 8

cacheFunction · 0.45
dismissChildMethod · 0.45
getMethod · 0.45
getJsonCacheMethod · 0.45
rerunCallBackMethod · 0.45
getMemoryCacheMethod · 0.45
getCachedValueMethod · 0.45
index.tsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected