From 85e4e92bf06c7d6a59be149cdb7e32208f13ddcb Mon Sep 17 00:00:00 2001 From: Alan Shaw Date: Tue, 4 Sep 2018 15:11:01 +0100 Subject: [PATCH] feat: add cid-base option to ipfs.resolve HTTP API License: MIT Signed-off-by: Alan Shaw --- src/cli/commands/ls.js | 3 ++- src/cli/utils.js | 8 -------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/cli/commands/ls.js b/src/cli/commands/ls.js index 25a1dc8e04..cf20083a0c 100644 --- a/src/cli/commands/ls.js +++ b/src/cli/commands/ls.js @@ -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 ', diff --git a/src/cli/utils.js b/src/cli/utils.js index 04c3bbb501..02f830f6c6 100644 --- a/src/cli/utils.js +++ b/src/cli/utils.js @@ -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) -}