@nxtedition/deepstream.io-client-js 28.1.21 → 28.1.22
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-handler.js +10 -1
package/package.json
CHANGED
|
@@ -450,7 +450,7 @@ class RecordHandler {
|
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
-
put(name, version, data) {
|
|
453
|
+
put(name, version, data, parent) {
|
|
454
454
|
if (typeof name !== 'string' || name.startsWith('_')) {
|
|
455
455
|
throw new Error('invalid argument: name')
|
|
456
456
|
}
|
|
@@ -463,7 +463,16 @@ class RecordHandler {
|
|
|
463
463
|
throw new Error('invalid argument: data')
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
+
if (parent != null && (typeof version !== 'string' || !/^\d+-/.test(version))) {
|
|
467
|
+
throw new Error('invalid argument: parent')
|
|
468
|
+
}
|
|
469
|
+
|
|
466
470
|
const update = [name, version, jsonPath.stringify(data)]
|
|
471
|
+
|
|
472
|
+
if (parent) {
|
|
473
|
+
update.push(parent)
|
|
474
|
+
}
|
|
475
|
+
|
|
467
476
|
this._connection.sendMsg(C.TOPIC.RECORD, C.ACTIONS.PUT, update)
|
|
468
477
|
|
|
469
478
|
this._putting.set(update, [])
|