fileFromStats = ({ cumulativeSize, type, size, cid, name, path, pinned, isParent }, prefix = '/ipfs') => ({
  size: cumulativeSize || size || 0,
  type: type === 'dir' ? 'directory' : type,
  cid,
  name: name || path.split('/').pop() || cid.toString(),
  path: path || `${prefix}/${cid.toString()}`,
  pinned: Boolean(pinned),
  isParent
})
@typedef {Object} FileStat
@property {number} size
@property {'directory'|'file'|'unknown'} type
@property {CID} cid
@property {string} name
@property {string} path
@property {boolean} pinned
@property {boolean|void} isParent

@param {Object} stat
@param {'dir'|'directory'|'file'|'unknown'} stat.type
@param {CID} stat.cid
@param {string} stat.path
@param {number} [stat.cumulativeSize]
@param {number} stat.size
@param {string|void} [stat.name]
@param {boolean|void} [stat.pinned]
@param {boolean|void} [stat.isParent]
@param {string} [prefix]
@returns {FileStat}