Skip to content
This repository was archived by the owner on May 25, 2025. It is now read-only.

Commit 9b03a07

Browse files
fix: types
1 parent 7a2c15c commit 9b03a07

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/commondao/common.dao.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ export class CommonDao<
484484

485485
async streamQueryAsDBMForEach(
486486
q: DBQuery<DBM>,
487-
mapper: AsyncMapper<DBM, void>,
487+
mapper: AsyncMapper<Saved<DBM>, void>,
488488
opt: CommonDaoStreamForEachOptions<DBM> = {},
489489
): Promise<void> {
490490
q.table = opt.table || q.table
@@ -515,7 +515,7 @@ export class CommonDao<
515515
errorMode: opt.errorMode,
516516
},
517517
),
518-
transformMap<DBM, void>(mapper, {
518+
transformMap<Saved<DBM>, void>(mapper, {
519519
...opt,
520520
predicate: _passthroughPredicate, // to be able to logProgress
521521
}),
@@ -535,7 +535,10 @@ export class CommonDao<
535535
/**
536536
* Stream as Readable, to be able to .pipe() it further with support of backpressure.
537537
*/
538-
streamQueryAsDBM(q: DBQuery<DBM>, opt: CommonDaoStreamOptions<DBM> = {}): ReadableTyped<DBM> {
538+
streamQueryAsDBM(
539+
q: DBQuery<DBM>,
540+
opt: CommonDaoStreamOptions<DBM> = {},
541+
): ReadableTyped<Saved<DBM>> {
539542
q.table = opt.table || q.table
540543
opt.skipValidation = opt.skipValidation !== false // default true
541544
opt.skipConversion = opt.skipConversion !== false // default true

src/query/dbQuery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export class RunnableDBQuery<
297297
}
298298

299299
async streamQueryAsDBMForEach(
300-
mapper: AsyncMapper<DBM, void>,
300+
mapper: AsyncMapper<Saved<DBM>, void>,
301301
opt?: CommonDaoStreamForEachOptions<DBM>,
302302
): Promise<void> {
303303
await this.dao.streamQueryAsDBMForEach(this, mapper, opt)
@@ -307,7 +307,7 @@ export class RunnableDBQuery<
307307
return this.dao.streamQuery(this, opt)
308308
}
309309

310-
streamQueryAsDBM(opt?: CommonDaoStreamOptions<DBM>): ReadableTyped<DBM> {
310+
streamQueryAsDBM(opt?: CommonDaoStreamOptions<DBM>): ReadableTyped<Saved<DBM>> {
311311
return this.dao.streamQueryAsDBM(this, opt)
312312
}
313313

0 commit comments

Comments
 (0)