@nxtedition/deepstream.io-client-js 24.1.14 → 24.1.15

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/deepstream.io-client-js",
3
- "version": "24.1.14",
3
+ "version": "24.1.15",
4
4
  "description": "the javascript client for deepstream.io",
5
5
  "homepage": "http://deepstream.io",
6
6
  "bugs": {
@@ -236,7 +236,7 @@ class Record {
236
236
  signal?.throwIfAborted()
237
237
  }
238
238
 
239
- update(pathOrUpdater, updaterOrNil) {
239
+ update(...args) {
240
240
  invariant(this._refs > 0, 'missing refs')
241
241
 
242
242
  if (this._version.charAt(0) === 'I') {
@@ -248,8 +248,9 @@ class Record {
248
248
  return Promise.resolve()
249
249
  }
250
250
 
251
- const path = arguments.length === 1 ? undefined : pathOrUpdater
252
- const updater = arguments.length === 1 ? pathOrUpdater : updaterOrNil
251
+ const options = args.at(-1) === 'object' ? args.pop() : null
252
+ const path = args.length === 1 ? undefined : args[0]
253
+ const updater = args.length === 1 ? args[0] : args[1]
253
254
 
254
255
  if (typeof updater !== 'function') {
255
256
  throw new Error('invalid argument: updater')
@@ -264,7 +265,7 @@ class Record {
264
265
  }
265
266
 
266
267
  this.ref()
267
- return this.when(C.RECORD_STATE.SERVER)
268
+ return this.when(C.RECORD_STATE.SERVER, options)
268
269
  .then(() => {
269
270
  const prev = this.get(path)
270
271
  const next = updater(prev, this._version)