mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
fix(ext/kv): expose Deno.AtomicOperation (#19674)
This commit is contained in:
parent
dd508c9c89
commit
476e4ed03c
3 changed files with 10 additions and 3 deletions
|
@ -46,7 +46,7 @@ Deno.test({
|
|||
},
|
||||
});
|
||||
|
||||
function dbTest(name: string, fn: (db: Deno.Kv) => Promise<void>) {
|
||||
function dbTest(name: string, fn: (db: Deno.Kv) => Promise<void> | void) {
|
||||
Deno.test({
|
||||
name,
|
||||
// https://github.com/denoland/deno/issues/18363
|
||||
|
@ -58,7 +58,7 @@ function dbTest(name: string, fn: (db: Deno.Kv) => Promise<void>) {
|
|||
try {
|
||||
await fn(db);
|
||||
} finally {
|
||||
await db.close();
|
||||
db.close();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
@ -1750,3 +1750,9 @@ Deno.test({
|
|||
}
|
||||
},
|
||||
});
|
||||
|
||||
dbTest("atomic operation is exposed", (db) => {
|
||||
assert(Deno.AtomicOperation);
|
||||
const ao = db.atomic();
|
||||
assert(ao instanceof Deno.AtomicOperation);
|
||||
});
|
||||
|
|
|
@ -657,4 +657,4 @@ class KvListIterator extends AsyncIterator
|
|||
}
|
||||
}
|
||||
|
||||
export { Kv, KvListIterator, KvU64, openKv };
|
||||
export { AtomicOperation, Kv, KvListIterator, KvU64, openKv };
|
||||
|
|
|
@ -173,6 +173,7 @@ const denoNsUnstable = {
|
|||
upgradeHttp: http.upgradeHttp,
|
||||
serve: http.serve,
|
||||
openKv: kv.openKv,
|
||||
AtomicOperation: kv.AtomicOperation,
|
||||
Kv: kv.Kv,
|
||||
KvU64: kv.KvU64,
|
||||
KvListIterator: kv.KvListIterator,
|
||||
|
|
Loading…
Reference in a new issue