@nxtedition/deepstream.io-client-js 23.2.1 → 23.2.3
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/package.json +1 -1
- package/src/record/record.js +12 -8
package/package.json
CHANGED
package/src/record/record.js
CHANGED
|
@@ -101,11 +101,11 @@ class Record {
|
|
|
101
101
|
|
|
102
102
|
if (!this._version) {
|
|
103
103
|
this._patches = path && this._patches ? this._patches : []
|
|
104
|
-
this._patches.push(path, jsonPath.
|
|
104
|
+
this._patches.push(path, jsonPath.stringify(data))
|
|
105
105
|
this._handler._patch.add(this)
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
if (this._update(path, data, false)) {
|
|
108
|
+
if (this._update(jsonPath.set(this._data, path, data, false))) {
|
|
109
109
|
this._emitUpdate()
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -251,11 +251,8 @@ class Record {
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
_update(
|
|
255
|
-
|
|
256
|
-
const nextData = jsonPath.set(prevData, path, data, isPlainObject)
|
|
257
|
-
|
|
258
|
-
if (nextData === prevData) {
|
|
254
|
+
_update(nextData) {
|
|
255
|
+
if (nextData === this._data) {
|
|
259
256
|
return false
|
|
260
257
|
}
|
|
261
258
|
|
|
@@ -294,9 +291,16 @@ class Record {
|
|
|
294
291
|
this._data = jsonPath.parse(data)
|
|
295
292
|
|
|
296
293
|
if (this._version.charAt(0) !== 'I') {
|
|
294
|
+
let patchData = this._data
|
|
297
295
|
for (let n = 0; n < this._patches.length; n += 2) {
|
|
298
|
-
|
|
296
|
+
patchData = jsonPath.set(
|
|
297
|
+
patchData,
|
|
298
|
+
this._patches[n + 0],
|
|
299
|
+
jsonPath.parse(this._patches[n + 1]),
|
|
300
|
+
true
|
|
301
|
+
)
|
|
299
302
|
}
|
|
303
|
+
this._update(patchData)
|
|
300
304
|
}
|
|
301
305
|
|
|
302
306
|
this._patches = null
|