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

fix: Improve BodyReadable type definition #1259

Merged
merged 2 commits into from Mar 3, 2022
Merged

Conversation

umarov
Copy link
Contributor

@umarov umarov commented Mar 1, 2022

Updates the body to use BodyReadable. Currently, body was using an intersection between Readable and BodyMixin.

This actually exposes the dump function in TypeScript now.

Let me know if the resume and abort are actually nullable. I looked at the code and abort is null initially. resume seems to be optional for Readable

Fixes #1256

@codecov-commenter
Copy link

codecov-commenter commented Mar 1, 2022

Codecov Report

Merging #1259 (84251c2) into main (901f9d6) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1259   +/-   ##
=======================================
  Coverage   94.10%   94.10%           
=======================================
  Files          44       44           
  Lines        4089     4089           
=======================================
  Hits         3848     3848           
  Misses        241      241           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 901f9d6...84251c2. Read the comment docs.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we tests our types using tsd. Could you add a test?

@umarov
Copy link
Contributor Author

umarov commented Mar 3, 2022

@mcollina does it make sense to add types from the BodyMixin into this BodyReadable? I tried adding type tests for those, but the class type I created does not have them. I saw that the BodyMixin already has some types. I wonder if it's redundant to have them in two places.

@umarov
Copy link
Contributor Author

umarov commented Mar 3, 2022

I can try pushing up what I have

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ronag ronag merged commit e66422c into nodejs:main Mar 3, 2022
@umarov umarov deleted the fix-1256 branch March 3, 2022 14:54
KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
* fix: Improve BodyReadable type definition

* fix: Add tests for BodyReadable type
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
* fix: Improve BodyReadable type definition

* fix: Add tests for BodyReadable type
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
* fix: Improve BodyReadable type definition

* fix: Add tests for BodyReadable type
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.

body.dump() is not available in type definitions
4 participants