From 18c969035d19760c220e4ae0e81c95e34635b9a5 Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Wed, 21 Mar 2018 23:20:56 +0100 Subject: [PATCH 1/2] feat: add ability to files.cat with a cid instance License: MIT Signed-off-by: Jacob Heun --- src/utils/clean-cid.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/utils/clean-cid.js b/src/utils/clean-cid.js index f73a1e004..dbc8386ee 100644 --- a/src/utils/clean-cid.js +++ b/src/utils/clean-cid.js @@ -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) } From 6f9c7c64e997de7abcd8b921d2c5076507fbef4d Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Thu, 22 Mar 2018 18:35:29 +0100 Subject: [PATCH 2/2] chore: update interface-ipfs-core version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 769d31cc2..0f2086c1b 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "go-ipfs-dep": "^0.4.13", "gulp": "^3.9.1", "hapi": "^17.2.3", - "interface-ipfs-core": "~0.56.5", + "interface-ipfs-core": "~0.58.0", "ipfs": "~0.28.2", "ipfsd-ctl": "~0.30.1", "pre-commit": "^1.2.2",