From e99f98ea061c9892abe1d1add8da9d7f0229c337 Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 16 Mar 2018 11:21:39 -0700 Subject: [PATCH 1/4] fix: do not use stream to value --- src/files/stat.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/files/stat.js b/src/files/stat.js index 804865ba0..c90a54faa 100644 --- a/src/files/stat.js +++ b/src/files/stat.js @@ -4,23 +4,23 @@ const promisify = require('promisify-es6') const _ = require('lodash') const streamToValue = require('../utils/stream-to-value') -const transform = function (res, callback) { - return streamToValue(res, (err, data) => { - if (err) { - return callback(err) - } +const transform = function (data, callback) { + // return streamToValue(res, (err, data) => { + // if (err) { + // return callback(err) + // } - callback(null, { - type: data[0].Type, - blocks: data[0].Blocks, - size: data[0].Size, - hash: data[0].Hash, - cumulativeSize: data[0].CumulativeSize, - withLocality: data[0].WithLocality || false, - local: data[0].Local || null, - sizeLocal: data[0].SizeLocal || null - }) + callback(null, { + type: data[0].Type, + blocks: data[0].Blocks, + size: data[0].Size, + hash: data[0].Hash, + cumulativeSize: data[0].CumulativeSize, + withLocality: data[0].WithLocality || false, + local: data[0].Local || null, + sizeLocal: data[0].SizeLocal || null }) + // }) } module.exports = (send) => { From 28bff0a30b3fbc0b2a357a99140dd1085794ad4c Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 16 Mar 2018 11:22:03 -0700 Subject: [PATCH 2/4] chore: update interface-ipfs-core --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6f02f35fe..7dfea405d 100644 --- a/package.json +++ b/package.json @@ -72,8 +72,8 @@ "eslint-plugin-react": "^7.7.0", "go-ipfs-dep": "^0.4.13", "gulp": "^3.9.1", - "hapi": "^17.2.2", - "interface-ipfs-core": "~0.56.0", + "hapi": "^17.2.3", + "interface-ipfs-core": "~0.56.3", "ipfs": "~0.28.2", "ipfsd-ctl": "~0.30.1", "pre-commit": "^1.2.2", From 298afdeec119801ea4ac30e441481793ed9269c9 Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 16 Mar 2018 11:38:11 -0700 Subject: [PATCH 3/4] fix: go-ipfs has not shipped withLocal yet --- package.json | 2 +- src/files/stat.js | 23 ++++++++--------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 7dfea405d..c02f48548 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.3", + "interface-ipfs-core": "~0.56.4", "ipfs": "~0.28.2", "ipfsd-ctl": "~0.30.1", "pre-commit": "^1.2.2", diff --git a/src/files/stat.js b/src/files/stat.js index c90a54faa..4077d1945 100644 --- a/src/files/stat.js +++ b/src/files/stat.js @@ -2,25 +2,18 @@ const promisify = require('promisify-es6') const _ = require('lodash') -const streamToValue = require('../utils/stream-to-value') const transform = function (data, callback) { - // return streamToValue(res, (err, data) => { - // if (err) { - // return callback(err) - // } - callback(null, { - type: data[0].Type, - blocks: data[0].Blocks, - size: data[0].Size, - hash: data[0].Hash, - cumulativeSize: data[0].CumulativeSize, - withLocality: data[0].WithLocality || false, - local: data[0].Local || null, - sizeLocal: data[0].SizeLocal || null + type: data.Type, + blocks: data.Blocks, + size: data.Size, + hash: data.Hash, + cumulativeSize: data.CumulativeSize, + withLocality: data.WithLocality || false, + local: data.Local || undefined, + sizeLocal: data.SizeLocal || undefined }) - // }) } module.exports = (send) => { From 71e068d5180f66bea58113875068796bd7d0d7e7 Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 16 Mar 2018 11:46:26 -0700 Subject: [PATCH 4/4] chore: update deps --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c02f48548..4f0846e10 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.4", + "interface-ipfs-core": "~0.56.5", "ipfs": "~0.28.2", "ipfsd-ctl": "~0.30.1", "pre-commit": "^1.2.2",