From 8c92499d85917693d2f87252419f0eeccd239a2b Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 8 Feb 2021 19:59:19 +0100 Subject: idb: add first web platform tests, fix issues detected by them --- packages/idb-bridge/src/util/makeStoreKeyValue.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'packages/idb-bridge/src/util/makeStoreKeyValue.ts') diff --git a/packages/idb-bridge/src/util/makeStoreKeyValue.ts b/packages/idb-bridge/src/util/makeStoreKeyValue.ts index b535bced5..2281e983d 100644 --- a/packages/idb-bridge/src/util/makeStoreKeyValue.ts +++ b/packages/idb-bridge/src/util/makeStoreKeyValue.ts @@ -17,7 +17,7 @@ import extractKey from "./extractKey"; import { DataError } from "./errors"; import valueToKey from "./valueToKey"; -import structuredClone from "./structuredClone"; +import { structuredClone } from "./structuredClone"; import injectKey from "./injectKey"; import { IDBKeyPath, IDBValidKey } from "../idbtypes"; @@ -32,7 +32,7 @@ export function makeStoreKeyValue( key: IDBValidKey | undefined, currentKeyGenerator: number, autoIncrement: boolean, - keyPath: IDBKeyPath | null, + keyPath: IDBKeyPath | IDBKeyPath[] | null, ): StoreKeyResult { const haveKey = key !== null && key !== undefined; const haveKeyPath = keyPath !== null && keyPath !== undefined; @@ -63,7 +63,11 @@ export function makeStoreKeyValue( }; } else { // (yes, no, no) - throw new DataError(); + return { + key: key!, + value: value, + updatedKeyGenerator: currentKeyGenerator, + }; } } } else { -- cgit v1.2.3