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

Commit e91d0d8

Browse files
committed
fix: ipfs ls: allow any depth. Should fix #1079
1 parent e223888 commit e91d0d8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/components/files.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,11 @@ module.exports = function files (self) {
161161
}
162162

163163
function _lsPullStreamImmutable (ipfsPath) {
164+
const path = normalizePath(ipfsPath)
165+
const depth = path.split('/').length
164166
return pull(
165-
exporter(ipfsPath, self._ipldResolver, { maxDepth: 1 }),
166-
pull.filter((node) => node.depth === 1),
167+
exporter(ipfsPath, self._ipldResolver, { maxDepth: depth }),
168+
pull.filter((node) => node.depth === depth),
167169
pull.map((node) => {
168170
node = Object.assign({}, node, { hash: toB58String(node.hash) })
169171
delete node.content

0 commit comments

Comments
 (0)