From 9d12c12a08f213a54690d327d3b464c30014194b Mon Sep 17 00:00:00 2001 From: rzvxa Date: Sun, 31 Dec 2023 17:49:38 +0330 Subject: [PATCH] fix: add default any type to the errors --- src/try.ts | 2 +- src/tryFn.ts | 2 +- tests/try.spec.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/try.ts b/src/try.ts index 040c024..192ee01 100644 --- a/src/try.ts +++ b/src/try.ts @@ -12,7 +12,7 @@ import { Ok, Err } from "./result"; * * @returns A `Promise` to a `Result` containing the result of `promise` or the error it may have thrown. */ -function try$( +function try$( // eslint-disable-line @typescript-eslint/no-explicit-any promise: Promise ): Promise> & Dwaitable> { const task = Promise.resolve(promise) diff --git a/src/tryFn.ts b/src/tryFn.ts index b2cf4b3..3b3f1e7 100644 --- a/src/tryFn.ts +++ b/src/tryFn.ts @@ -15,7 +15,7 @@ type AnyFunction = (...args: any[]) => any; * * @returns A `Result` containing the result of `fn` or the error it may have thrown. */ -function tryFn$( +function tryFn$( // eslint-disable-line @typescript-eslint/no-explicit-any fn: TFunc, ...args: Parameters ): Result, TError> { diff --git a/tests/try.spec.ts b/tests/try.spec.ts index 60b83d3..07d72bd 100644 --- a/tests/try.spec.ts +++ b/tests/try.spec.ts @@ -27,7 +27,7 @@ describe("try$ Tests", () => { }); test("should return a promise which can be turned into a DeferredPromise using dwait function", async () => { - const result = try$(resolveMock()).dwait().isErr(); + const result = try$(resolveMock()).dwait().isErr(); await expect(result).resolves.toEqual(false); }); });