From 658bad289486a708f81fee0bd99b6bcecfd09c74 Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 16 Mar 2018 12:02:20 -0700 Subject: [PATCH] fix: last fixes for green (#719) * fix: do not use stream to value * chore: update interface-ipfs-core * fix: go-ipfs has not shipped withLocal yet * chore: update deps --- package.json | 4 ++-- src/files/stat.js | 27 ++++++++++----------------- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 6f02f35fe..4f0846e10 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.5", "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 804865ba0..4077d1945 100644 --- a/src/files/stat.js +++ b/src/files/stat.js @@ -2,24 +2,17 @@ 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) - } - - 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 - }) +const transform = function (data, callback) { + callback(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 }) }