-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from oliver-oloughlin/float16array-support
feat: support for Float16Array
- Loading branch information
Showing
10 changed files
with
119 additions
and
416 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
import type { DenoKv } from "../../mod.ts" | ||
import type { Kv } from "../test.deps.ts" | ||
|
||
function check(_: DenoKv) {} | ||
import { openKv } from "npm:@deno/kv" | ||
import { kvdex } from "../../mod.ts" | ||
|
||
Deno.test("db - properties", async (t) => { | ||
await t.step("Should allow native Deno KV type", () => { | ||
check(null as unknown as Deno.Kv) | ||
await t.step("Should allow native Deno KV type", async () => { | ||
const kv = await Deno.openKv() | ||
kvdex(kv, {}) | ||
kv.close() | ||
}) | ||
|
||
await t.step("Should allow NPM Deno KV type", () => { | ||
check(null as unknown as Kv) | ||
await t.step("Should allow NPM Deno KV type", async () => { | ||
const kv = await openKv() | ||
kvdex(kv, {}) | ||
kv.close() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { collection, kvdex, model } from "../../mod.ts" | ||
import { assert, assertEquals } from "../test.deps.ts" | ||
import { useKv } from "../utils.ts" | ||
import { TObject } from "../values.ts" | ||
|
||
Deno.test("indexable_collection - types", async (t) => { | ||
await t.step( | ||
"Should allow and properly store/retrieve all KvValue types", | ||
async () => { | ||
await useKv(async (kv) => { | ||
const db = kvdex(kv, { | ||
objects: collection(model<typeof TObject>(), { | ||
indices: { | ||
TString: "primary", | ||
TNumber: "secondary", | ||
}, | ||
}), | ||
}) | ||
|
||
const cr = await db.objects.add(TObject) | ||
assert(cr.ok) | ||
|
||
const doc = await db.objects.find(cr.id) | ||
assertEquals(doc?.value, TObject) | ||
}) | ||
}, | ||
) | ||
}) |
Oops, something went wrong.