Skip to content

Commit

Permalink
chore: Type casting to the left
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavoguichard committed Apr 8, 2024
1 parent 5b807f1 commit 8df5bd3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/all.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('all', () => {

assertEquals(
await c({ id: 1 }),
makeSuccessResult([2, 0] as [number, number]),
makeSuccessResult<[number, number]>([2, 0]),
)
})

Expand All @@ -36,7 +36,7 @@ describe('all', () => {
const results = await d({ id: 1 })
assertEquals(
results,
makeSuccessResult(['1', 2, true] as [string, number, boolean]),
makeSuccessResult<[string, number, boolean]>(['1', 2, true]),
)
})

Expand Down
2 changes: 1 addition & 1 deletion src/branch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('branch', () => {

assertEquals(
await d({ id: 1 }),
makeSuccessResult([4, { id: 3 }] as [number, { id: number }]),
makeSuccessResult<[number, { id: number }]>([4, { id: 3 }]),
)
})
})
28 changes: 13 additions & 15 deletions src/sequence.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ describe('sequence', () => {

assertEquals(
await c({ id: 1 }),
makeSuccessResult([{ id: 3 }, { result: 2 }] as [
{ id: number },
{ result: number },
makeSuccessResult<[{ id: number }, { result: number }]>([
{ id: 3 },
{ result: 2 },
]),
)
})
Expand All @@ -49,9 +49,9 @@ describe('sequence', () => {

assertEquals(
await c(undefined, { env: 1 }),
makeSuccessResult([{ inp: 3 }, { result: 4 }] as [
{ inp: number },
{ result: number },
makeSuccessResult<[{ inp: number }, { result: number }]>([
{ inp: 3 },
{ result: 4 },
]),
)
})
Expand Down Expand Up @@ -159,15 +159,13 @@ describe('sequence', () => {

assertEquals(
await d({ aNumber: 1 }),
makeSuccessResult([
{ aString: '1' },
{ aBoolean: true },
{ anotherBoolean: false },
] as [
{ aString: string },
{ aBoolean: boolean },
{ anotherBoolean: boolean },
]),
makeSuccessResult<
[
{ aString: string },
{ aBoolean: boolean },
{ anotherBoolean: boolean },
]
>([{ aString: '1' }, { aBoolean: true }, { anotherBoolean: false }]),
)
})
})

0 comments on commit 8df5bd3

Please sign in to comment.