Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: ipfs ls: allow any depth. Should fix #1079
Browse files Browse the repository at this point in the history
  • Loading branch information
pgte committed Dec 15, 2017
1 parent e223888 commit e91d0d8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/components/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,11 @@ module.exports = function files (self) {
}

function _lsPullStreamImmutable (ipfsPath) {
const path = normalizePath(ipfsPath)
const depth = path.split('/').length
return pull(
exporter(ipfsPath, self._ipldResolver, { maxDepth: 1 }),
pull.filter((node) => node.depth === 1),
exporter(ipfsPath, self._ipldResolver, { maxDepth: depth }),
pull.filter((node) => node.depth === depth),
pull.map((node) => {
node = Object.assign({}, node, { hash: toB58String(node.hash) })
delete node.content
Expand Down

0 comments on commit e91d0d8

Please sign in to comment.