missing structuredClone caused unintended mutations
This commit is contained in:
parent
61bc36b90a
commit
78f885db3d
@ -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",
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user