Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
fix: get missing path
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw authored and vmx committed Sep 11, 2018
1 parent f493902 commit a069a0f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class IPLDResolver {
return true
} else {
// continue traversing
if (value) {
if (value && value['/']) {
cid = new CID(value['/'])
}
return false
Expand Down
8 changes: 8 additions & 0 deletions test/ipld-dag-cbor.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ module.exports = (repo) => {
})
})

it('resolver.get calls callback for unavailable path', (done) => {
resolver.get(cid3, `foo/${Date.now()}`, (err) => {
expect(err).to.exist()
expect(err.message).to.contain('path not available')
done()
})
})

it('resolver.tree', (done) => {
pull(
resolver.treeStream(cid3),
Expand Down

0 comments on commit a069a0f

Please sign in to comment.