diff --git a/src/files/stat.js b/src/files/stat.js index 804865ba0..d53da0dab 100644 --- a/src/files/stat.js +++ b/src/files/stat.js @@ -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 }) } @@ -29,9 +18,6 @@ module.exports = (send) => { callback = opts opts = {} } - - opts = _.mapKeys(opts, (v, k) => _.kebabCase(k)) - send.andTransform({ path: 'files/stat', args: args, diff --git a/test/files.spec.js b/test/files.spec.js index f2cee3040..40ba4ce50 100644 --- a/test/files.spec.js +++ b/test/files.spec.js @@ -332,10 +332,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()