diff options
-rw-r--r-- | packages/idb-bridge/package.json | 2 | ||||
-rw-r--r-- | packages/idb-bridge/src/MemoryBackend.ts | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/packages/idb-bridge/package.json b/packages/idb-bridge/package.json index 940f1747b..e69341c37 100644 --- a/packages/idb-bridge/package.json +++ b/packages/idb-bridge/package.json @@ -1,6 +1,6 @@ { "name": "idb-bridge", - "version": "0.0.1", + "version": "0.0.2", "description": "IndexedDB implementation that uses SQLite3 as storage", "main": "./build/index.js", "types": "./build/index.d.ts", diff --git a/packages/idb-bridge/src/MemoryBackend.ts b/packages/idb-bridge/src/MemoryBackend.ts index 9cdfd8a0e..d14d63a77 100644 --- a/packages/idb-bridge/src/MemoryBackend.ts +++ b/packages/idb-bridge/src/MemoryBackend.ts @@ -1027,7 +1027,7 @@ export class MemoryBackend implements Backend { if (!result) { throw Error("invariant violated"); } - values.push(result.value); + values.push(structuredClone(result.value)); } } } else { @@ -1086,7 +1086,7 @@ export class MemoryBackend implements Backend { } if (req.resultLevel >= ResultLevel.Full) { - values.push(res.value); + values.push(structuredClone(res.value)); } numResults++; @@ -1168,8 +1168,8 @@ export class MemoryBackend implements Backend { } const objectStoreRecord: ObjectStoreRecord = { - primaryKey: key, - value: value, + primaryKey: structuredClone(key), + value: structuredClone(value), }; objectStore.modifiedData = modifiedData.with(key, objectStoreRecord, true); |