@cocreate/indexeddb 1.22.0 → 1.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.22.2](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.22.1...v1.22.2) (2024-02-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update responds with update request not whole document ([1a0f2f0](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/1a0f2f0907aa62e3588621cc7d53260c81eb1c51))
7
+
8
+ ## [1.22.1](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.22.0...v1.22.1) (2024-02-17)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * update object only returns updated values ([005f9ea](https://github.com/CoCreate-app/CoCreate-indexeddb/commit/005f9ea18d8fb2e15b74c4101c11f8f73bb49f4e))
14
+
1
15
  # [1.22.0](https://github.com/CoCreate-app/CoCreate-indexeddb/compare/v1.21.2...v1.22.0) (2024-02-14)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/indexeddb",
3
- "version": "1.22.0",
3
+ "version": "1.22.2",
4
4
  "description": "A simple indexeddb component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "indexeddb",
package/src/index.js CHANGED
@@ -611,8 +611,9 @@ function openCursor(objectStore, range, direction, data, newData, isFilter, inde
611
611
  data[type][i] = await add(objectStore, data[type][i])
612
612
  } else if (data.method == 'object.update') {
613
613
  let update = createUpdate((cursor && cursor.value) ? cursor.value : {}, data[type][i], globalOperators)
614
- if (update)
615
- data[type][i] = await put(objectStore, update)
614
+ if (update) {
615
+ await put(objectStore, update)
616
+ }
616
617
  }
617
618
  data[type][i] = { ...reference, ...data[type][i] }
618
619
 
@@ -635,7 +636,8 @@ function openCursor(objectStore, range, direction, data, newData, isFilter, inde
635
636
  if (data.method == 'object.update') {
636
637
  let update = createUpdate(cursor.value, data[type][i], globalOperators)
637
638
  if (update)
638
- result = await cursorUpdate(cursor, update)
639
+ await cursorUpdate(cursor, update)
640
+ result = data[type][i]
639
641
  // result = cursor.update(update)
640
642
  hasUpdated = true
641
643
  // set dotnotation for keys with $operators for items that end in [] to be used by socket.id