Skip to content

Commit

Permalink
fix: Don't cast fetch log messages as strings
Browse files Browse the repository at this point in the history
This was leading to logging of things like "[object Object]" because that is the result of `String({})`
  • Loading branch information
jsloat committed Dec 3, 2024
1 parent 80e8ed2 commit c68e96c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fetch/fetchBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ const getResponseError = (response: unknown): string | null => {

export default async <Returns = unknown>(opts: FetchOpts<Returns>) => {
const parsedOpts = parseFetchOpts(opts);
const log = (message: any, isVerbose = false) =>
fetchDebug({ message: String(message), parsedOpts, isVerbose });
const log = (message: unknown, isVerbose = false) =>
fetchDebug({ message, parsedOpts, isVerbose });
const { url, fetchFnKey, responseValidator } = parsedOpts;

await log(`Initiating request to "${url}"...`);
Expand Down

0 comments on commit c68e96c

Please sign in to comment.