Skip to content

Commit

Permalink
chore: move only in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Dec 13, 2023
1 parent 7149251 commit 50f00e5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/utils/kv.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const OpenKV = () => import('@deno/kv')

export const useKv = async () => {
if (globalThis.Deno) {
return globalThis.Deno.openKv()
}
const { openKv } = await OpenKV()
return openKv('kv.db')
if (process.dev) {
const OpenKV = () => import('@deno/kv')
const { openKv } = await OpenKV()
return openKv('kv.db')
}
}

0 comments on commit 50f00e5

Please sign in to comment.