Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KvKeyPart types lists symbol as valid, this is not supported #22674

Open
kitsonk opened this issue Mar 3, 2024 · 1 comment
Open

KvKeyPart types lists symbol as valid, this is not supported #22674

kitsonk opened this issue Mar 3, 2024 · 1 comment
Labels
bug Something isn't working correctly ext/kv Related to "Deno.openKv()" API good first issue Good for newcomers types Issues related to TypeScript types

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Mar 3, 2024

Version: Deno 1.41.0

The unstable types for Deno.KvKeyPart indicates that a symbol is a valid key part:

export type KvKeyPart =
| Uint8Array
| string
| number
| bigint
| boolean
| symbol;

But using a symbol as a key part results in the following error:

Uncaught TypeError: expected string, number, bigint, ArrayBufferView, boolean
    at doAtomicWriteInPlace (ext:deno_kv/01_db.ts:624:16)
    at Kv.set (ext:deno_kv/01_db.ts:97:32)
    at <anonymous>:1:31
@littledivy littledivy added bug Something isn't working correctly ext/kv Related to "Deno.openKv()" API labels Mar 4, 2024
@lucacasonato lucacasonato added good first issue Good for newcomers types Issues related to TypeScript types labels Jun 12, 2024
@lucacasonato
Copy link
Member

The bug is in the type - this should not be a valid type in the key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly ext/kv Related to "Deno.openKv()" API good first issue Good for newcomers types Issues related to TypeScript types
Projects
None yet
Development

No branches or pull requests

3 participants