diff options
author | Florian Dold <florian@dold.me> | 2021-02-08 19:59:19 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-02-08 19:59:19 +0100 |
commit | 8c92499d85917693d2f87252419f0eeccd239a2b (patch) | |
tree | 569d0ee1c25d62caf0ac87131ecfa8166d12c62b /packages/idb-bridge/src/util/makeStoreKeyValue.ts | |
parent | 5ff5a686e4f15dea839b18fda9275687557d23a7 (diff) | |
download | wallet-core-8c92499d85917693d2f87252419f0eeccd239a2b.tar.xz |
idb: add first web platform tests, fix issues detected by them
Diffstat (limited to 'packages/idb-bridge/src/util/makeStoreKeyValue.ts')
-rw-r--r-- | packages/idb-bridge/src/util/makeStoreKeyValue.ts | 10 |
1 files changed, 7 insertions, 3 deletions
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 { |