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

Commit 54d5977

Browse files
ready
1 parent c24e027 commit 54d5977

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/util.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
const UnixFS = require('ipfs-unixfs')
44
const pull = require('pull-stream')
55
const mh = require('multihashes')
6-
const parallel = require('async/parallel')
76

87
exports.switchType = (node, dirHandler, fileHandler) => {
98
const data = UnixFS.unmarshal(node.data)
109
const type = data.type
1110

12-
if (type === 'directory') return dirHandler()
13-
if (type === 'file') return fileHandler()
11+
if (type === 'directory') {
12+
return dirHandler()
13+
}
14+
15+
if (type === 'file') {
16+
return fileHandler()
17+
}
1418

1519
return pull.error(new Error('Unkown node type'))
1620
}
@@ -22,10 +26,3 @@ exports.cleanMultihash = (multihash) => {
2226

2327
return multihash
2428
}
25-
26-
exports.getSizeAndHash = (n, cb) => {
27-
parallel({
28-
multihash: (cb) => n.multihash(cb),
29-
size: (cb) => n.size(cb)
30-
}, cb)
31-
}

0 commit comments

Comments
 (0)