@naturalcycles/datastore-lib 3.33.0 → 3.34.0

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.
@@ -151,12 +151,9 @@ class DatastoreDB extends db_lib_1.BaseCommonDB {
151
151
  ...this.cfg.streamOptions,
152
152
  ..._opt,
153
153
  };
154
- const stream = (opt.experimentalCursorStream
154
+ return (opt.experimentalCursorStream
155
155
  ? new DatastoreStreamReadable_1.DatastoreStreamReadable(q, opt, (0, js_lib_1.commonLoggerMinLevel)(this.cfg.logger, opt.debug ? 'log' : 'warn'))
156
- : this.ds().runQueryStream(q))
157
- // .on('error', err => stream.emit('error', err))
158
- .map(chunk => this.mapId(chunk));
159
- return stream;
156
+ : this.ds().runQueryStream(q)).map(chunk => this.mapId(chunk));
160
157
  }
161
158
  streamQuery(dbQuery, opt) {
162
159
  const q = (0, query_util_1.dbQueryToDatastoreQuery)(dbQuery, this.ds().createQuery(dbQuery.table));
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@naturalcycles/datastore-lib",
3
- "version": "3.33.0",
3
+ "version": "3.34.0",
4
4
  "description": "Opinionated library to work with Google Datastore",
5
5
  "scripts": {
6
6
  "prepare": "husky"
7
7
  },
8
8
  "dependencies": {
9
- "@google-cloud/datastore": "^8.0.0",
9
+ "@google-cloud/datastore": "^9.0.0",
10
10
  "@naturalcycles/db-lib": "^9.0.0",
11
11
  "@naturalcycles/js-lib": "^14.116.0",
12
12
  "@naturalcycles/nodejs-lib": "^13.1.0"
@@ -252,19 +252,15 @@ export class DatastoreDB extends BaseCommonDB implements CommonDB {
252
252
  ..._opt,
253
253
  }
254
254
 
255
- const stream: ReadableTyped<ROW> = (
255
+ return (
256
256
  opt.experimentalCursorStream
257
257
  ? new DatastoreStreamReadable<ROW>(
258
258
  q,
259
259
  opt,
260
260
  commonLoggerMinLevel(this.cfg.logger, opt.debug ? 'log' : 'warn'),
261
261
  )
262
- : this.ds().runQueryStream(q)
263
- )
264
- // .on('error', err => stream.emit('error', err))
265
- .map(chunk => this.mapId(chunk))
266
-
267
- return stream
262
+ : (this.ds().runQueryStream(q) as ReadableTyped<ROW>)
263
+ ).map(chunk => this.mapId(chunk))
268
264
  }
269
265
 
270
266
  override streamQuery<ROW extends ObjectWithId>(