Skip to content

Commit

Permalink
InferResult should output plural. (#1064)
Browse files Browse the repository at this point in the history
  • Loading branch information
igalklebanov authored Jul 7, 2024
1 parent aa45498 commit 9d88f3d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: tests

on:
push:
branches: [master]
branches: [master, v*]
pull_request:
branches: [master]
branches: [master, v*]

jobs:
node:
Expand Down
2 changes: 1 addition & 1 deletion src/util/infer-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ type ResolveResult<O> = O extends
| UpdateResult
| DeleteResult
| MergeResult
? O
? O[]
: Simplify<O>[]
8 changes: 4 additions & 4 deletions test/typings/test-d/infer-result.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function testInferResultInsertQuery(db: Kysely<Database>) {
})
const compiledQuery0 = query0.compile()

type Expected0 = InsertResult
type Expected0 = InsertResult[]
expectType<Equals<Expected0, InferResult<typeof query0>>>(true)
expectType<Equals<Expected0, InferResult<typeof compiledQuery0>>>(true)

Expand All @@ -74,7 +74,7 @@ function testInferResultUpdateQuery(db: Kysely<Database>) {
.where('pet.id', '=', '1')
const compiledQuery0 = query0.compile()

type Expected0 = UpdateResult
type Expected0 = UpdateResult[]
expectType<Equals<Expected0, InferResult<typeof query0>>>(true)
expectType<Equals<Expected0, InferResult<typeof compiledQuery0>>>(true)

Expand Down Expand Up @@ -111,7 +111,7 @@ function testInferResultDeleteQuery(db: Kysely<Database>) {
const query0 = db.deleteFrom('pet').where('id', '=', '1')
const compiledQuery0 = query0.compile()

type Expected0 = DeleteResult
type Expected0 = DeleteResult[]
expectType<Equals<Expected0, InferResult<typeof query0>>>(true)
expectType<Equals<Expected0, InferResult<typeof compiledQuery0>>>(true)

Expand All @@ -138,7 +138,7 @@ function testInferResultMergeQuery(db: Kysely<Database>) {
.thenDelete()
const compiledQuery0 = query0.compile()

type Expected0 = MergeResult
type Expected0 = MergeResult[]
expectType<Equals<Expected0, InferResult<typeof query0>>>(true)
expectType<Equals<Expected0, InferResult<typeof compiledQuery0>>>(true)
}

0 comments on commit 9d88f3d

Please sign in to comment.