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

Unify body to buffer #552

Merged
merged 1 commit into from
Nov 15, 2018
Merged

Unify body to buffer #552

merged 1 commit into from
Nov 15, 2018

Conversation

jimmywarting
Copy link
Collaborator

@jimmywarting jimmywarting commented Nov 15, 2018

Forgot to make a PR.
Hade it ready two days ago

This remove some redundant code by normalizing the input body to buffer and eventually make it easier to make a stream getter out of it (res.body, req.body)

Report:

----------------|----------|----------|----------|----------|-------------------|
File            |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------------|----------|----------|----------|----------|-------------------|
All files       |    96.07 |    92.93 |      100 |    95.98 |                   |
 abort-error.js |      100 |      100 |      100 |      100 |                   |
 body.js        |    88.39 |    80.16 |      100 |       88 |... 16,320,321,326 |
 fetch-error.js |      100 |      100 |      100 |      100 |                   |
 headers.js     |      100 |      100 |      100 |      100 |                   |
 index.js       |      100 |      100 |      100 |      100 |                   |
 request.js     |    98.55 |    99.02 |      100 |    98.53 |               205 |
 response.js    |      100 |      100 |      100 |      100 |                   |
----------------|----------|----------|----------|----------|-------------------|

@jimmywarting jimmywarting added this to the Version 3.0.0 milestone Nov 15, 2018
@bitinn
Copy link
Collaborator

bitinn commented Nov 15, 2018

LGTM, it's good that none of our tests depends on internal data structure.

@bitinn bitinn merged commit 7d32932 into node-fetch:master Nov 15, 2018
@jimmywarting jimmywarting deleted the unify-body branch November 15, 2018 15:24
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.

None yet

2 participants