Skip to content

fix(client): correct return types when throw option is true#127

Open
Iulian-Dragomirescu wants to merge 1 commit intobetter-auth:mainfrom
Iulian-Dragomirescu:fix-client-throw-types
Open

fix(client): correct return types when throw option is true#127
Iulian-Dragomirescu wants to merge 1 commit intobetter-auth:mainfrom
Iulian-Dragomirescu:fix-client-throw-types

Conversation

@Iulian-Dragomirescu
Copy link
Copy Markdown

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.

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.
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.

1 participant