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

Commit

Permalink
fix: remove starting slash
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Mar 11, 2017
1 parent bf1cb6d commit ad47ffa
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
10 changes: 5 additions & 5 deletions src/resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ exports.tree = (block, options, callback) => {
}

const paths = []
paths.push('/Links')
paths.push('Links')

node.links.forEach((link, i) => {
paths.push(`/Links/${i}/Name`)
paths.push(`/Links/${i}/Tsize`)
paths.push(`/Links/${i}/Hash`)
paths.push(`Links/${i}/Name`)
paths.push(`Links/${i}/Tsize`)
paths.push(`Links/${i}/Hash`)
})

paths.push('/Data')
paths.push('Data')

callback(null, paths)
})
Expand Down
36 changes: 18 additions & 18 deletions test/resolver.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ describe('IPLD Format resolver (local)', () => {
resolver.tree(emptyNodeBlock, (err, paths) => {
expect(err).to.not.exist
expect(paths).to.eql([
'/Links',
'/Data'
'Links',
'Data'
])
done()
})
Expand Down Expand Up @@ -160,14 +160,14 @@ describe('IPLD Format resolver (local)', () => {
resolver.tree(linksNodeBlock, (err, paths) => {
expect(err).to.not.exist
expect(paths).to.eql([
'/Links',
'/Links/0/Name',
'/Links/0/Tsize',
'/Links/0/Hash',
'/Links/1/Name',
'/Links/1/Tsize',
'/Links/1/Hash',
'/Data'
'Links',
'Links/0/Name',
'Links/0/Tsize',
'Links/0/Hash',
'Links/1/Name',
'Links/1/Tsize',
'Links/1/Hash',
'Data'
])
done()
})
Expand Down Expand Up @@ -206,14 +206,14 @@ describe('IPLD Format resolver (local)', () => {
resolver.tree(dataLinksNodeBlock, (err, paths) => {
expect(err).to.not.exist
expect(paths).to.eql([
'/Links',
'/Links/0/Name',
'/Links/0/Tsize',
'/Links/0/Hash',
'/Links/1/Name',
'/Links/1/Tsize',
'/Links/1/Hash',
'/Data'
'Links',
'Links/0/Name',
'Links/0/Tsize',
'Links/0/Hash',
'Links/1/Name',
'Links/1/Tsize',
'Links/1/Hash',
'Data'
])
done()
})
Expand Down

0 comments on commit ad47ffa

Please sign in to comment.