From 02a34c423db56f165045704b7c805663f2059232 Mon Sep 17 00:00:00 2001 From: Viktoriia Date: Mon, 26 Feb 2024 15:30:41 +0100 Subject: [PATCH] fix types --- src/services/refact.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/refact.ts b/src/services/refact.ts index f8626854..9d294274 100644 --- a/src/services/refact.ts +++ b/src/services/refact.ts @@ -159,7 +159,8 @@ export function isStatisticDataResponse( json: unknown, ): json is { data: string } { if (!json || typeof json !== "object") return false; - return typeof (json as { data?: unknown }).data === "string"; + if (!("data" in json)) return false; + return typeof json.data === "string"; } export async function getStatisticData(