@nxtedition/lib 19.0.49 → 19.0.50

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
@@ -138,23 +138,32 @@ function getRecord(ds, name, ...args) {
138
138
  )
139
139
  }
140
140
 
141
- function query(ds, designId, options) {
141
+ function query(
142
+ ds,
143
+ designId,
144
+ { startkey, endkey, key, sorted, descending, limit },
145
+ state = ds.record.PROVIDER,
146
+ ) {
142
147
  const next = (startkey, prevRows, limit) =>
143
148
  Number.isFinite(limit) && limit <= 0
144
149
  ? rxjs.of({ rows: prevRows })
145
- : ds.nxt.record
150
+ : ds.record
146
151
  .observe(
147
152
  `${designId}:design?${qs.stringify(
148
153
  {
149
- ...options,
150
154
  startkey,
155
+ endkey,
156
+ key,
157
+ sorted,
158
+ descending,
151
159
  limit: Number.isFinite(limit) ? limit : null,
152
160
  },
153
161
  { skipNulls: true },
154
162
  )}`,
155
- ds.record.PROVIDER,
163
+ state,
156
164
  )
157
165
  .pipe(
166
+ rxjs.filter(({ rows }) => Array.isArray(rows)),
158
167
  rxjs.switchMap(({ rows, finished }) => {
159
168
  // assert(Array.isArray(rows))
160
169
  // assert(typeof finished === 'boolean')
@@ -170,7 +179,7 @@ function query(ds, designId, options) {
170
179
  }
171
180
  }),
172
181
  )
173
- return next(options.startkey, [], options.limit ?? Infinity)
182
+ return next(startkey, [], limit ?? Infinity)
174
183
  }
175
184
 
176
185
  export function makeDeepstream(ds) {
package/errors.js CHANGED
@@ -55,8 +55,7 @@ export function serializeError(error) {
55
55
  }
56
56
 
57
57
  if (Array.isArray(error)) {
58
- const errors = error.map(serializeError).filter(Boolean)
59
- return errors
58
+ return error.map(serializeError).filter(Boolean)
60
59
  }
61
60
 
62
61
  if (Object.prototype.hasOwnProperty.call(error, kSeen)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "19.0.49",
3
+ "version": "19.0.50",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",