Skip to content

Commit

Permalink
- Fix any
Browse files Browse the repository at this point in the history
- Fix tests
  • Loading branch information
alexshelkov committed Jul 25, 2021
1 parent 64f11fd commit 09c7b19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/__tests__/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ describe('onErr', () => {

describe('chaining onOk and onErr', () => {
it('success then error', () => {
expect.assertions(8);
expect.assertions(6);

const rOk = rnd(true);

Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface Transform<Data, Fail> {
cb: (data: Data, res: Result<Data, never>) => Result<Data2, Fail2>
): Result<Data2, Fail | Fail2>;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
onErr<Res extends string | Err | PartialSuccess<any> | PartialFailure<any>>(
cb: (err: Fail, res: Result<never, Fail>) => Res
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand All @@ -53,6 +54,7 @@ export interface Transform<Data, Fail> {
cb: (err: Fail, res: Result<never, Fail>) => Result<never, Fail2>
): Result<Data, Fail2>;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
onErr<Res extends string | Err | PartialSuccess<any> | PartialFailure<any>>(
cb: (err: Fail, res: Result<never, Fail>) => Res
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down

0 comments on commit 09c7b19

Please sign in to comment.