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

Commit

Permalink
feat: add ability to files.cat with a cid instance
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Jacob Heun <jacobheun@gmail.com>
  • Loading branch information
jacobheun authored and daviddias committed Mar 22, 2018
1 parent 43d1c1a commit aeeb94e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/clean-cid.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ module.exports = function (cid) {
if (Buffer.isBuffer(cid)) {
cid = bs58.encode(cid)
}
if (CID.isCID(cid)) {
cid = cid.toBaseEncodedString()
}
if (typeof cid !== 'string') {
throw new Error('unexpected cid type: ' + typeof cid)
}
Expand Down

0 comments on commit aeeb94e

Please sign in to comment.