From 4ea0380bed7ba1ff88c45c17cc0d9f246bd26e77 Mon Sep 17 00:00:00 2001 From: Kir_Antipov Date: Wed, 3 Jan 2024 18:19:54 +0000 Subject: [PATCH] Fixed the return type of `isCurseForgeError` Previously, it would return `undefined` instead of `false` when `error` was undefined. --- src/platforms/curseforge/curseforge-error.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platforms/curseforge/curseforge-error.ts b/src/platforms/curseforge/curseforge-error.ts index ce7b08f..62dd650 100644 --- a/src/platforms/curseforge/curseforge-error.ts +++ b/src/platforms/curseforge/curseforge-error.ts @@ -23,7 +23,7 @@ export interface CurseForgeError { export function isCurseForgeError(error: unknown): error is CurseForgeError { const e = error as CurseForgeError; return ( - e && + !!e && typeof e.errorCode === "number" && typeof e.errorMessage === "string" );