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

Commit 01d8583

Browse files
committed
some style corrections
1 parent 2b92345 commit 01d8583

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/builder/balanced/balanced-reducer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function balancedReduceToRoot (reduce, options) {
1212

1313
const result = pushable()
1414

15-
reduceToParents(source, function (err, roots) {
15+
reduceToParents(source, (err, roots) => {
1616
if (err) {
1717
result.emit('error', err)
1818
return // early

src/builder/builder.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const defaultOptions = {
1919
}
2020
}
2121

22-
module.exports = function (Chunker, ipldResolver, Reducer, _options) {
22+
module.exports = function (createChunker, ipldResolver, createReducer, _options) {
2323
const options = extend({}, defaultOptions, _options)
2424

2525
return function (source, files) {
@@ -84,11 +84,11 @@ module.exports = function (Chunker, ipldResolver, Reducer, _options) {
8484
return callback(new Error('invalid content'))
8585
}
8686

87-
const reducer = Reducer(reduce(file, ipldResolver), options)
87+
const reducer = createReducer(reduce(file, ipldResolver), options)
8888

8989
pull(
9090
file.content,
91-
Chunker(options.chunkerOptions),
91+
createChunker(options.chunkerOptions),
9292
pull.map(chunk => new Buffer(chunk)),
9393
pull.map(buffer => new UnixFS('file', buffer)),
9494
pull.asyncMap((fileNode, callback) => {

src/builder/flat/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = function (reduce, options) {
1414
source,
1515
batch(Infinity),
1616
pull.asyncMap(reduce),
17-
pull.collect(function (err, roots) {
17+
pull.collect((err, roots) => {
1818
if (err) {
1919
result.emit('error', err)
2020
return // early

test/test-balanced-builder.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const options = {
1919
}
2020

2121
describe('balanced builder', () => {
22-
it('reduces one value into itself', callback => {
22+
it('reduces one value into itself', (callback) => {
2323
pull(
2424
pull.values([1]),
2525
builder(reduce, options),
@@ -31,7 +31,7 @@ describe('balanced builder', () => {
3131
)
3232
})
3333

34-
it('reduces 3 values into parent', callback => {
34+
it('reduces 3 values into parent', (callback) => {
3535
pull(
3636
pull.values([1, 2, 3]),
3737
builder(reduce, options),
@@ -45,7 +45,7 @@ describe('balanced builder', () => {
4545
)
4646
})
4747

48-
it('obeys max children per node', callback => {
48+
it('obeys max children per node', (callback) => {
4949
pull(
5050
pull.values([1, 2, 3, 4]),
5151
builder(reduce, options),
@@ -66,7 +66,7 @@ describe('balanced builder', () => {
6666
)
6767
})
6868

69-
it('refolds 2 parent nodes', callback => {
69+
it('refolds 2 parent nodes', (callback) => {
7070
pull(
7171
pull.values([1, 2, 3, 4, 5, 6, 7]),
7272
builder(reduce, options),

test/test-flat-builder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function reduce (leaves, callback) {
1515
}
1616

1717
describe('flat builder', () => {
18-
it('reduces one value into itself', callback => {
18+
it('reduces one value into itself', (callback) => {
1919
pull(
2020
pull.values([1]),
2121
builder(reduce),
@@ -27,7 +27,7 @@ describe('flat builder', () => {
2727
)
2828
})
2929

30-
it('reduces 2 values into parent', callback => {
30+
it('reduces 2 values into parent', (callback) => {
3131
pull(
3232
pull.values([1, 2]),
3333
builder(reduce),

0 commit comments

Comments
 (0)