MCPcopy
hub / github.com/loggerhead/json4u / get

Method get

src/lib/supabase/server.ts:60–73  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

58 }
59
60 async get(key: string): Promise<{ value: Json; expiredAt?: Date }> {
61 const { data, error } = await this.client.from("kv").select().eq("key", key).maybeSingle();
62 if (error) {
63 throw error;
64 }
65
66 const value = data?.value as string;
67 const expiredAt = data?.expired_at;
68
69 return {
70 value: value ? JSON.parse(value) : undefined,
71 expiredAt: expiredAt ? new Date(expiredAt) : undefined,
72 };
73 }
74
75 async set(key: string, value: any, expiredAt?: Date) {
76 const expired_at = expiredAt ? expiredAt.toISOString() : undefined;

Callers 15

doGetStatisticsFunction · 0.95
addFunctionWasmFunction · 0.45
callRuntimeCallbacksFunction · 0.45
jq.jsFile · 0.45
___sys_fcntl64Function · 0.45
___sys_ioctlFunction · 0.45
___sys_openFunction · 0.45
useConfigFromCookiesFunction · 0.45
setTableRevealPositionFunction · 0.45
urlToMapFunction · 0.45
addCellFunction · 0.45
image.tsFile · 0.45

Calls 1

eqMethod · 0.80

Tested by

no test coverage detected