Skip to content

Commit 4070c42

Browse files
authored
fix
1 parent deef3fe commit 4070c42

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/swr-openapi/src/query-base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { Fetcher, SWRHook } from "swr";
44
import type { TypesForGetRequest } from "./types.js";
55
import { useCallback, useDebugValue, useMemo } from "react";
66

7-
export const RESPONSE = Symbol.for('response');
7+
export const RESPONSE = Symbol.for("response");
88

99
/**
1010
* @private
@@ -43,7 +43,7 @@ export function configureBaseQueryHook(useHook: SWRHook) {
4343
});
4444
throw res.error;
4545
}
46-
if (res.data) {
46+
if (res.data && typeof res.data === "object") {
4747
Object.defineProperty(res.data, RESPONSE, {
4848
value: res.response,
4949
enumerable: false,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy