diff --git a/.github/workflows/npm-release.yml b/.github/workflows/npm-release.yml index 93a92a73..eee73b2a 100644 --- a/.github/workflows/npm-release.yml +++ b/.github/workflows/npm-release.yml @@ -17,12 +17,12 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: setup deno - uses: denoland/setup-deno@v1 + uses: denoland/setup-deno@v2 with: - deno-version: v1.x + deno-version: v2.x - name: Get Version id: vars diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml index 45436211..5a0e2f83 100644 --- a/.github/workflows/verify.yaml +++ b/.github/workflows/verify.yaml @@ -15,12 +15,12 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: setup deno - uses: denoland/setup-deno@v1 + uses: denoland/setup-deno@v2 with: - deno-version: v1.46.x + deno-version: v2.x - name: Setup Node uses: actions/setup-node@v2 diff --git a/lib/call.ts b/lib/call.ts index 86e0662a..fb9cfb89 100644 --- a/lib/call.ts +++ b/lib/call.ts @@ -123,7 +123,7 @@ export function call(callable: Callable): Operation { resolve(yield* toop(callable)); } } catch (error) { - reject(error); + reject(error as Error); } }); } diff --git a/lib/context.ts b/lib/context.ts index 39ac0612..cc4ecd59 100644 --- a/lib/context.ts +++ b/lib/context.ts @@ -27,5 +27,5 @@ export function createContext(key: string, defaultValue?: T): Context { } class MissingContextError extends Error { - name = "MissingContextError"; + override name = "MissingContextError"; } diff --git a/lib/main.ts b/lib/main.ts index 68e36651..93e8fe51 100644 --- a/lib/main.ts +++ b/lib/main.ts @@ -113,7 +113,7 @@ export async function main( yield* exit(0); } catch (error) { - resolve({ status: 1, error }); + resolve({ status: 1, error: error as Error }); } finally { clearInterval(interval); } diff --git a/lib/race.ts b/lib/race.ts index d4e83563..1fbe82ac 100644 --- a/lib/race.ts +++ b/lib/race.ts @@ -33,7 +33,7 @@ export function race>( try { resolve((yield* operation) as Yielded); } catch (error) { - reject(error); + reject(error as Error); } }); } diff --git a/lib/run/frame.ts b/lib/run/frame.ts index 0e15967e..19b69722 100644 --- a/lib/run/frame.ts +++ b/lib/run/frame.ts @@ -98,7 +98,7 @@ export function createFrame(options: FrameOptions): Frame { result: yield* instruction(frame), }); } catch (error) { - k.tail({ type: "settled", result: Err(error) }); + k.tail({ type: "settled", result: Err(error as Error) }); } }); @@ -117,7 +117,7 @@ export function createFrame(options: FrameOptions): Frame { } } } catch (error) { - thunks.unshift({ done: true, value: Err(error) }); + thunks.unshift({ done: true, value: Err(error as Error) }); } thunk = thunks.pop()!; } diff --git a/test/queue.test.ts b/test/queue.test.ts index 44282ed5..b456fa1f 100644 --- a/test/queue.test.ts +++ b/test/queue.test.ts @@ -58,7 +58,7 @@ function abortAfter(op: Operation, ms: number): Operation { try { resolve(yield* op); } catch (error) { - reject(error); + reject(error as Error); } }); yield* sleep(ms); diff --git a/test/run.test.ts b/test/run.test.ts index 52c803a9..c764d389 100644 --- a/test/run.test.ts +++ b/test/run.test.ts @@ -257,7 +257,7 @@ describe("run()", () => { }); throw new Error("expected error to propagate"); } catch (error) { - expect(error.message).toEqual("boom"); + expect((error as Error).message).toEqual("boom"); } }); @@ -268,7 +268,7 @@ describe("run()", () => { }); throw new Error("expected error to propagate"); } catch (error) { - expect(error.message).toEqual("boom"); + expect((error as Error).message).toEqual("boom"); } }); diff --git a/test/suite.ts b/test/suite.ts index 2e9f292c..3f89295e 100644 --- a/test/suite.ts +++ b/test/suite.ts @@ -96,7 +96,7 @@ export function useCommand( if ( !!error && - !error.message.includes("Child process has already terminated") + !(error as Error).message.includes("Child process has already terminated") ) { // deno-lint-ignore no-unsafe-finally throw error;