Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
feat: add cid-base option to ipfs.resolve HTTP API
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
  • Loading branch information
alanshaw authored and Alan Shaw committed Sep 19, 2018
1 parent ed20113 commit 85e4e92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/cli/commands/ls.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
'use strict'

const multibase = require('multibase')
const { cidToString, print, rightpad } = require('../utils')
const { print, rightpad } = require('../utils')
const { cidToString } = require('../../utils/cid')

module.exports = {
command: 'ls <key>',
Expand Down
8 changes: 0 additions & 8 deletions src/cli/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,3 @@ exports.rightpad = (val, n) => {
exports.ipfsPathHelp = 'ipfs uses a repository in the local file system. By default, the repo is ' +
'located at ~/.jsipfs. To change the repo location, set the $IPFS_PATH environment variable:\n\n' +
'export IPFS_PATH=/path/to/ipfsrepo\n'

// Stringify a CID in the requested base, auto-converting to v1 if necessary
exports.cidToString = (cid, base) => {
if (cid.version === 0 && base && base !== 'base58btc') {
cid = cid.toV1()
}
return cid.toBaseEncodedString(base)
}

0 comments on commit 85e4e92

Please sign in to comment.