Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to get the unresolved Response for corner case support #34

Merged
merged 3 commits into from
Dec 15, 2023
Merged

Add a way to get the unresolved Response for corner case support #34

merged 3 commits into from
Dec 15, 2023

Conversation

MatthewAry
Copy link
Contributor

So this is not completely finished. I am not good enough with TypeScript to figure out how to modify the Sign type in the src/treaty/type.ts file to explicitly return a Response type when getRaw: true is used. I spent hours trying to figure it out.

This PR modifies edenTreaty:

EdenTreaty.<1>.<2>.<n>.<method>({
    ...body,
    $query?: {},
    $fetch?: RequestInit,
    getRaw?: boolean // Will cause the return type to be simply the unread Response object
})

See https://discord.com/channels/1044804142461362206/1182023123852345364

I welcome any suggestions on how to make the type capabilities of edenTreaty more accurate when working with this feature.

@MatthewAry MatthewAry closed this Dec 6, 2023
@MatthewAry MatthewAry reopened this Dec 6, 2023
@MatthewAry MatthewAry changed the title Refactor createProxy function to support getRaw option Add a way to get the unresolved for corner case support Dec 6, 2023
@MatthewAry MatthewAry changed the title Add a way to get the unresolved for corner case support Add a way to get the unresolved Response for corner case support Dec 7, 2023
@SaltyAom SaltyAom merged commit aaa5499 into elysiajs:main Dec 15, 2023
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