Skip to content

Commit

Permalink
Simplify ReturningMethod so that it avoids infinite type recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauri Svan committed May 21, 2022
1 parent 8f88965 commit 27eaba0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions typings/objection/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,14 +625,12 @@ declare namespace Objection {
}

interface ReturningMethod {
<QB extends AnyQueryBuilder>(
<QB extends AnyQueryBuilder, QB2 extends AnyQueryBuilder>(
this: QB,
column: string | string[]
): QB extends ArrayQueryBuilder<QB>
? ArrayQueryBuilder<QB>
: QB extends NumberQueryBuilder<QB>
? ArrayQueryBuilder<QB>
: SingleQueryBuilder<QB>;
): QB extends NumberQueryBuilder<QB2>
? ArrayQueryBuilder<QB2>
: QB;
}

interface TimeoutOptions {
Expand Down

0 comments on commit 27eaba0

Please sign in to comment.