Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Jan 19, 2024
1 parent 7a2c15c commit 9b03a07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/commondao/common.dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ export class CommonDao<

async streamQueryAsDBMForEach(
q: DBQuery<DBM>,
mapper: AsyncMapper<DBM, void>,
mapper: AsyncMapper<Saved<DBM>, void>,
opt: CommonDaoStreamForEachOptions<DBM> = {},
): Promise<void> {
q.table = opt.table || q.table
Expand Down Expand Up @@ -515,7 +515,7 @@ export class CommonDao<
errorMode: opt.errorMode,
},
),
transformMap<DBM, void>(mapper, {
transformMap<Saved<DBM>, void>(mapper, {
...opt,
predicate: _passthroughPredicate, // to be able to logProgress
}),
Expand All @@ -535,7 +535,10 @@ export class CommonDao<
/**
* Stream as Readable, to be able to .pipe() it further with support of backpressure.
*/
streamQueryAsDBM(q: DBQuery<DBM>, opt: CommonDaoStreamOptions<DBM> = {}): ReadableTyped<DBM> {
streamQueryAsDBM(
q: DBQuery<DBM>,
opt: CommonDaoStreamOptions<DBM> = {},
): ReadableTyped<Saved<DBM>> {
q.table = opt.table || q.table
opt.skipValidation = opt.skipValidation !== false // default true
opt.skipConversion = opt.skipConversion !== false // default true
Expand Down
4 changes: 2 additions & 2 deletions src/query/dbQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export class RunnableDBQuery<
}

async streamQueryAsDBMForEach(
mapper: AsyncMapper<DBM, void>,
mapper: AsyncMapper<Saved<DBM>, void>,
opt?: CommonDaoStreamForEachOptions<DBM>,
): Promise<void> {
await this.dao.streamQueryAsDBMForEach(this, mapper, opt)
Expand All @@ -307,7 +307,7 @@ export class RunnableDBQuery<
return this.dao.streamQuery(this, opt)
}

streamQueryAsDBM(opt?: CommonDaoStreamOptions<DBM>): ReadableTyped<DBM> {
streamQueryAsDBM(opt?: CommonDaoStreamOptions<DBM>): ReadableTyped<Saved<DBM>> {
return this.dao.streamQueryAsDBM(this, opt)
}

Expand Down

0 comments on commit 9b03a07

Please sign in to comment.