From 22c62694563e98a170fdd53c538481157aa27039 Mon Sep 17 00:00:00 2001 From: Alex Walker Date: Tue, 23 Sep 2025 13:56:38 +0100 Subject: [PATCH 1/2] HTTP/TS: Fix response type checks throwing on certain inputs --- http-ts/src/response.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http-ts/src/response.ts b/http-ts/src/response.ts index 6b2239001d..5b3b6b2145 100644 --- a/http-ts/src/response.ts +++ b/http-ts/src/response.ts @@ -100,9 +100,9 @@ export function isApiError(err: any): err is ApiError { export type ApiResponse = ApiOkResponse | ApiErrorResponse; export function isOkResponse(res: ApiResponse): res is ApiOkResponse { - return "ok" in res; + return typeof res === "object" && "ok" in res; } export function isApiErrorResponse(res: ApiResponse): res is ApiErrorResponse { - return "err" in res; + return typeof res === "object" && "err" in res; } From 02ce17659a3e303a9cfac6b7dc8ae480f8805422 Mon Sep 17 00:00:00 2001 From: Alex Walker Date: Tue, 23 Sep 2025 14:09:05 +0100 Subject: [PATCH 2/2] fix checkstyle. --- http-ts/BUILD | 1 + 1 file changed, 1 insertion(+) diff --git a/http-ts/BUILD b/http-ts/BUILD index bfee475833..fa1224b88f 100644 --- a/http-ts/BUILD +++ b/http-ts/BUILD @@ -106,6 +106,7 @@ checkstyle_test( "tool/**/*", ]), exclude = glob([ + ".npmrc", "**/*.json", "**/*.md", "pnpm-lock.yaml",