From b41de11a5a87a88c578c01df4ae619759024bd52 Mon Sep 17 00:00:00 2001 From: dfedoryshchev Date: Fri, 10 Jul 2026 11:13:31 +0100 Subject: [PATCH] docs: fix isJsonContentType example to type-check --- packages/toolkit/src/query/fetchBaseQuery.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/toolkit/src/query/fetchBaseQuery.ts b/packages/toolkit/src/query/fetchBaseQuery.ts index 425804329e..77e23c0aaa 100644 --- a/packages/toolkit/src/query/fetchBaseQuery.ts +++ b/packages/toolkit/src/query/fetchBaseQuery.ts @@ -132,7 +132,7 @@ export type FetchBaseQueryArgs = { * in a predicate function for your given api to get the same automatic stringifying behavior * @example * ```ts - * const isJsonContentType = (headers: Headers) => ["application/vnd.api+json", "application/json", "application/vnd.hal+json"].includes(headers.get("content-type")?.trim()); + * const isJsonContentType = (headers: Headers) => ["application/vnd.api+json", "application/json", "application/vnd.hal+json"].includes((headers.get("content-type") ?? "").trim()); * ``` */ isJsonContentType?: (headers: Headers) => boolean