@nxtedition/lib 19.5.0 → 19.5.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/deepstream.js CHANGED
@@ -169,10 +169,15 @@ function query(ds, designId, params, state = ds.record.PROVIDER) {
169
169
  if (finished) {
170
170
  return rxjs.of({ rows: nextRows })
171
171
  } else {
172
- const last = rows.pop()
172
+ let nextKey = rows.pop().key
173
173
  // assert(last.key)
174
174
  // assert(rows.length > 0)
175
- return next(last.key, nextRows, limit - rows.length)
175
+ if (nextKey === startkey) {
176
+ // TODO (fix): We need to use startkey_docid to properly handle this...
177
+ // See, https://docs.couchdb.org/en/stable/ddocs/views/pagination.html#paging-alternate-method
178
+ nextKey += '\u0000'
179
+ }
180
+ return next(nextKey, nextRows, limit - rows.length)
176
181
  }
177
182
  }),
178
183
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "19.5.0",
3
+ "version": "19.5.2",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -558,7 +558,7 @@ export default function ({ ds, proxify, compiler }) {
558
558
  throw new Error(`invalid argument: path (${path})`)
559
559
  }
560
560
 
561
- if (state != null && typeof state !== 'string') {
561
+ if (state != null && typeof state !== 'string' && typeof state !== 'number') {
562
562
  throw new Error(`invalid argument: state (${state})`)
563
563
  }
564
564