Skip to content

[backport v1.3.x] fix(client): correct return types when throw option is true#148

Merged
bytaesu merged 2 commits into
v1.3.xfrom
backport-127-to-v1.3.x
Jun 9, 2026
Merged

[backport v1.3.x] fix(client): correct return types when throw option is true#148
bytaesu merged 2 commits into
v1.3.xfrom
backport-127-to-v1.3.x

Conversation

@better-release

@better-release better-release Bot commented Jun 9, 2026

Copy link
Copy Markdown

Description

Backport of #127 to v1.3.x.

When throw: true is set in client options, the response type should be the data directly, not { data, error } wrapper. This fix uses the third generic parameter of BetterFetchResponse to properly infer the return type based on the throw option.

(cherry picked from commit 31e5f8f)
@pkg-pr-new

pkg-pr-new Bot commented Jun 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/better-call@148

commit: 197abf0

@bytaesu bytaesu merged commit ff03a8a into v1.3.x Jun 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants