Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Last fixes for green #719

Merged
merged 4 commits into from
Mar 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
27 changes: 10 additions & 17 deletions src/files/stat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}

Expand Down