mirror of
https://github.com/sr229/kuru-kuru.git
synced 2024-09-20 04:10:33 +00:00
1a42b2ccf0
Signed-off-by: GitHub <noreply@github.com>
11 lines
325 B
TypeScript
11 lines
325 B
TypeScript
const kv = await Deno.openKv();
|
|
|
|
export async function getGlobalStatistics() {
|
|
const res = await kv.get<number>(["global-statistics"]) ?? 0;
|
|
return res.value ?? 0;
|
|
}
|
|
|
|
export async function setGlobalStatistics(value: number) {
|
|
const pv = await getGlobalStatistics();
|
|
await kv.set(["global-statistics"], pv + value);
|
|
}
|