From 2a3a1268f29dfbbfe792bda88525b424deeeb346 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Thu, 11 Jan 2024 17:21:43 -0500 Subject: [PATCH] chore(internal): narrow type into stringifyQuery (#253) --- src/core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index add3d06d..b00ebe99 100644 --- a/src/core.ts +++ b/src/core.ts @@ -452,8 +452,8 @@ export abstract class APIClient { query = { ...defaultQuery, ...query } as Req; } - if (query) { - url.search = this.stringifyQuery(query); + if (typeof query === 'object' && query && !Array.isArray(query)) { + url.search = this.stringifyQuery(query as Record); } return url.toString();