@nxtedition/lib 19.0.21 → 19.0.23

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.
Files changed (2) hide show
  1. package/deepstream.js +14 -9
  2. package/package.json +1 -1
package/deepstream.js CHANGED
@@ -122,20 +122,25 @@ function get(ds, name, ...args) {
122
122
  function query(ds, designId, options) {
123
123
  const next = (startkey, prevRows, limit) =>
124
124
  !limit
125
- ? rxjs.of({ rows: prevRows ?? [] })
125
+ ? rxjs.of({ rows: prevRows })
126
126
  : ds.nxt.record
127
127
  .observe(
128
- designId,
129
- {
130
- ...options,
131
- startkey,
132
- limit: Number.isFinite(limit) ? limit : null,
133
- },
128
+ `${designId}:design?${qs.stringify(
129
+ {
130
+ ...options,
131
+ startkey,
132
+ limit: Number.isFinite(limit) ? limit : null,
133
+ },
134
+ { skipNulls: true },
135
+ )}`,
134
136
  ds.record.PROVIDER,
135
137
  )
136
138
  .pipe(
137
139
  rxjs.switchMap(({ rows, finished }) => {
138
- const nextRows = prevRows ? [...prevRows, ...rows] : rows
140
+ assert(Array.isArray(rows))
141
+ assert(typeof finished === 'boolean')
142
+
143
+ const nextRows = prevRows.length ? [...prevRows, ...rows] : rows
139
144
  if (finished) {
140
145
  return rxjs.of({ rows: nextRows })
141
146
  } else {
@@ -146,7 +151,7 @@ function query(ds, designId, options) {
146
151
  }
147
152
  }),
148
153
  )
149
- return next(options.startkey, null, options.limit ?? Infinity)
154
+ return next(options.startkey, [], options.limit ?? Infinity)
150
155
  }
151
156
 
152
157
  export function makeDeepstream(ds) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "19.0.21",
3
+ "version": "19.0.23",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",