Skip to content
This repository was archived by the owner on Apr 29, 2020. It is now read-only.

Commit 0109807

Browse files
committed
chore: remove the conditional
1 parent 69504ea commit 0109807

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/builder/builder.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ const defaultOptions = {
2424
rawLeaves: false,
2525
hashAlg: 'sha2-256',
2626
leafType: 'file',
27-
cidVersion: 0
27+
cidVersion: 0,
28+
progress: () => {}
2829
}
2930

3031
module.exports = function builder (createChunker, ipld, createReducer, _options) {
@@ -106,10 +107,8 @@ module.exports = function builder (createChunker, ipld, createReducer, _options)
106107
pull(
107108
file.content,
108109
chunker,
109-
through(chunk => {
110-
if (options.progress && typeof options.progress === 'function') {
111-
options.progress(chunk.byteLength)
112-
}
110+
through(buffer => {
111+
options.progress(buffer.length)
113112
}),
114113
paraMap((buffer, callback) => {
115114
waterfall([

0 commit comments

Comments
 (0)