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

Commit

Permalink
Revert "feat: add support for ipfs files stat --with-local (#695)"
Browse files Browse the repository at this point in the history
This reverts commit b08f21a.
  • Loading branch information
vmx committed Mar 14, 2018
1 parent 1d762d0 commit 3d4f19a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
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

0 comments on commit 3d4f19a

Please sign in to comment.