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

Get CI Green #714

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"go-ipfs-dep": "^0.4.13",
"gulp": "^3.9.1",
"hapi": "^17.2.2",
"interface-ipfs-core": "~0.55.1",
"interface-ipfs-core": "https://github.com/ipfs/interface-ipfs-core#get-ci-green",
"ipfs": "~0.28.0",
"ipfsd-ctl": "~0.29.1",
"pre-commit": "^1.2.2",
Expand Down
26 changes: 6 additions & 20 deletions src/files/stat.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
'use strict'

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
})
callback(null, {
type: res.Type,
blocks: res.Blocks,
size: res.Size,
hash: res.Hash,
cumulativeSize: res.CumulativeSize
})
}

Expand All @@ -29,9 +18,6 @@ module.exports = (send) => {
callback = opts
opts = {}
}

opts = _.mapKeys(opts, (v, k) => _.kebabCase(k))

send.andTransform({
path: 'files/stat',
args: args,
Expand Down
5 changes: 1 addition & 4 deletions test/files.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,7 @@ describe('.files (the MFS API part)', function () {
size: 12,
cumulativeSize: 20,
blocks: 0,
type: 'file',
withLocality: false,
local: undefined,
sizeLocal: undefined
type: 'file'
})

done()
Expand Down