@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 +14 -5
- package/errors.js +1 -2
- package/package.json +1 -1
package/deepstream.js
CHANGED
|
@@ -138,23 +138,32 @@ function getRecord(ds, name, ...args) {
|
|
|
138
138
|
)
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
function query(
|
|
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.
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
59
|
-
return errors
|
|
58
|
+
return error.map(serializeError).filter(Boolean)
|
|
60
59
|
}
|
|
61
60
|
|
|
62
61
|
if (Object.prototype.hasOwnProperty.call(error, kSeen)) {
|