Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

feat: init stream to buffer #1

Merged
merged 7 commits into from Feb 28, 2018
Merged

feat: init stream to buffer #1

merged 7 commits into from Feb 28, 2018

Conversation

dead-horse
Copy link
Contributor

No description provided.

@dead-horse
Copy link
Contributor Author

done();
}

function done() {

Choose a reason for hiding this comment

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

这个要 once?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

promise 只会 resolve 一次,这个多次调用也无所谓的

index.js Outdated
function done() {
if (error) reject(error);
else resolve(Buffer.concat(bufs));
cleanup();

Choose a reason for hiding this comment

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

先 removeListener?

Copy link

Choose a reason for hiding this comment

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

先 cleanup 再返回

@codecov-io
Copy link

codecov-io commented Feb 28, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@fdd5499). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##             master     #1   +/-   ##
=======================================
  Coverage          ?   100%           
=======================================
  Files             ?      1           
  Lines             ?     29           
  Branches          ?      0           
=======================================
  Hits              ?     29           
  Misses            ?      0           
  Partials          ?      0
Impacted Files Coverage Δ
index.js 100% <100%> (ø)

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 fdd5499...a76f90a. Read the comment docs.

}

function done() {
cleanup();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

放到前面了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

额,这个还不能放前面,bufs 被清空了。问题不大,反正都是同步的。

@dead-horse
Copy link
Contributor Author

@fengmk2 @popomore 再看看确认一下

index.js Outdated
}

function cleanup() {
bufs = [];
Copy link

Choose a reason for hiding this comment

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

bufs = null

index.js Outdated

function cleanup() {
bufs = [];
error = null;
Copy link

Choose a reason for hiding this comment

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

bufs 和 error 都不需要设置吧

"name": "stream-to-buf",
"description": "convert stream to buffer",
"version": "1.0.0",
"homepage": "https://github.com/node-modules/stream-to-buf",
Copy link

Choose a reason for hiding this comment

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

stream-to-buffer 被抢。。。

@dead-horse dead-horse merged commit 3a99f5f into master Feb 28, 2018
@dead-horse dead-horse deleted the init branch February 28, 2018 09:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants