diff options
Diffstat (limited to 'packages/idb-bridge')
-rw-r--r-- | packages/idb-bridge/package.json | 2 | ||||
-rw-r--r-- | packages/idb-bridge/src/MemoryBackend.ts | 1 | ||||
-rw-r--r-- | packages/idb-bridge/src/util/structuredClone.ts | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/packages/idb-bridge/package.json b/packages/idb-bridge/package.json index 52bc872da..f3ed0888f 100644 --- a/packages/idb-bridge/package.json +++ b/packages/idb-bridge/package.json @@ -19,6 +19,7 @@ "@rollup/plugin-commonjs": "^17.1.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^11.2.0", + "@types/lodash": "^4.14.178", "@types/node": "^14.14.22", "ava": "^3.15.0", "esm": "^3.2.25", @@ -28,6 +29,7 @@ "typescript": "^4.1.3" }, "dependencies": { + "lodash": "^4.17.21", "tslib": "^2.1.0" }, "ava": { diff --git a/packages/idb-bridge/src/MemoryBackend.ts b/packages/idb-bridge/src/MemoryBackend.ts index 9233e8d88..41d0d7fbb 100644 --- a/packages/idb-bridge/src/MemoryBackend.ts +++ b/packages/idb-bridge/src/MemoryBackend.ts @@ -1070,6 +1070,7 @@ export class MemoryBackend implements Backend { btx: DatabaseTransaction, req: RecordGetRequest, ): Promise<RecordGetResponse> { + console.log(`getRecords ${req.objectStoreName}`); if (this.enableTracing) { console.log(`TRACING: getRecords`); console.log("query", req); diff --git a/packages/idb-bridge/src/util/structuredClone.ts b/packages/idb-bridge/src/util/structuredClone.ts index 181e9ca0e..b6b537433 100644 --- a/packages/idb-bridge/src/util/structuredClone.ts +++ b/packages/idb-bridge/src/util/structuredClone.ts @@ -14,6 +14,8 @@ permissions and limitations under the License. */ +import cloneDeep from "lodash/cloneDeep"; + const { toString: toStr } = {}; const hasOwn = {}.hasOwnProperty; const getProto = Object.getPrototypeOf; @@ -260,5 +262,5 @@ export function structuredRevive(val: any): any { * Structured clone for IndexedDB. */ export function structuredClone(val: any): any { - return structuredRevive(structuredEncapsulate(val)); + return cloneDeep(val); } |