Sanity check on KV key building (checking for string type)

This commit is contained in:
Zef Hemel
2025-11-07 10:43:57 +01:00
parent 732c6a5589
commit cc317d8451
+3
View File
@@ -83,6 +83,9 @@ export class IndexedDBKvPrimitives implements KvPrimitives {
private buildKey(key: KvKey): string {
for (const k of key) {
if (typeof k !== "string") {
throw new Error(`Key needs to consists of strings: ${key}`);
}
if (k.includes(sep)) {
throw new Error(`Key cannot contain ${sep}`);
}