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

Commit 85e4e92

Browse files
alanshawAlan Shaw
authored and
Alan Shaw
committed
feat: add cid-base option to ipfs.resolve HTTP API
License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent ed20113 commit 85e4e92

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/cli/commands/ls.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict'
22

33
const multibase = require('multibase')
4-
const { cidToString, print, rightpad } = require('../utils')
4+
const { print, rightpad } = require('../utils')
5+
const { cidToString } = require('../../utils/cid')
56

67
module.exports = {
78
command: 'ls <key>',

src/cli/utils.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,3 @@ exports.rightpad = (val, n) => {
118118
exports.ipfsPathHelp = 'ipfs uses a repository in the local file system. By default, the repo is ' +
119119
'located at ~/.jsipfs. To change the repo location, set the $IPFS_PATH environment variable:\n\n' +
120120
'export IPFS_PATH=/path/to/ipfsrepo\n'
121-
122-
// Stringify a CID in the requested base, auto-converting to v1 if necessary
123-
exports.cidToString = (cid, base) => {
124-
if (cid.version === 0 && base && base !== 'base58btc') {
125-
cid = cid.toV1()
126-
}
127-
return cid.toBaseEncodedString(base)
128-
}

0 commit comments

Comments
 (0)