Skip to content
This repository has been archived by the owner on Feb 12, 2024. 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
  • Loading branch information
jacobheun authored and daviddias committed Mar 22, 2018
1 parent c1e8db1 commit 2e332c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/components/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ function normalizePath (path) {
if (Buffer.isBuffer(path)) {
path = toB58String(path)
}
if (CID.isCID(path)) {
path = path.toBaseEncodedString()
}
if (path.indexOf('/ipfs/') === 0) {
path = path.substring('/ipfs/'.length)
}
Expand Down

0 comments on commit 2e332c8

Please sign in to comment.