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

Commit 6eed39e

Browse files
committed
lint
1 parent 58791eb commit 6eed39e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/api/cat.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ const isIPFS = require('is-ipfs')
55
const promisify = require('promisify-es6')
66

77
module.exports = (send) => {
8-
const cat = promisify((multihash, callback) => {
9-
try {
10-
multihash = cleanMultihash(multihash)
11-
} catch (err) {
12-
return callback(err)
13-
}
14-
send('cat', multihash, null, null, function (err, result) {
15-
if (err) {
16-
return callback(err)
17-
}
18-
return callback(null, result)
19-
})
20-
})
21-
return cat
8+
const cat = promisify((multihash, callback) => {
9+
try {
10+
multihash = cleanMultihash(multihash)
11+
} catch (err) {
12+
return callback(err)
13+
}
14+
send('cat', multihash, null, null, function (err, result) {
15+
if (err) {
16+
return callback(err)
17+
}
18+
return callback(null, result)
19+
})
20+
})
21+
return cat
2222
}
2323

2424
function cleanMultihash (multihash) {
25-
if (!isIPFS.multihash(multihash)) {
26-
throw new Error('not valid multihash')
27-
}
28-
if (Buffer.isBuffer(multihash)) {
29-
return bs58.encode(multihash)
30-
}
25+
if (!isIPFS.multihash(multihash)) {
26+
throw new Error('not valid multihash')
27+
}
28+
if (Buffer.isBuffer(multihash)) {
29+
return bs58.encode(multihash)
30+
}
3131
return multihash
3232
}

0 commit comments

Comments
 (0)