Skip to content

Type results of slicing and HTTP request content #768

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

Merged
merged 2 commits into from
Apr 28, 2025
Merged

Type results of slicing and HTTP request content #768

merged 2 commits into from
Apr 28, 2025

Conversation

Acconut
Copy link
Member

@Acconut Acconut commented Apr 28, 2025

The return value for the data in FileSource#slice is currently typed as unknown. As is the request content argument for HttpRequest#send. The original idea behind leaving them unknown is to accommodate platform-specific types (e.g. Buffer in Node.js). However, this leads to confusion in the implementations about what types have to be handled in the HTTP stack.

This PR adds proper types, so implementations know what types must be expected, creating more waterproof types.

@Acconut Acconut self-assigned this Apr 28, 2025
@Acconut Acconut merged commit 4dd2853 into main Apr 28, 2025
8 of 10 checks passed
@Acconut Acconut deleted the slicetypes branch April 28, 2025 11:25
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