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

Commit aeeb94e

Browse files
jacobheundaviddias
authored andcommitted
feat: add ability to files.cat with a cid instance
License: MIT Signed-off-by: Jacob Heun <jacobheun@gmail.com>
1 parent 43d1c1a commit aeeb94e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: src/utils/clean-cid.js

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ module.exports = function (cid) {
77
if (Buffer.isBuffer(cid)) {
88
cid = bs58.encode(cid)
99
}
10+
if (CID.isCID(cid)) {
11+
cid = cid.toBaseEncodedString()
12+
}
1013
if (typeof cid !== 'string') {
1114
throw new Error('unexpected cid type: ' + typeof cid)
1215
}

0 commit comments

Comments
 (0)