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

Commit

Permalink
fix: resolver.tree allow options to be ommitted
Browse files Browse the repository at this point in the history
Updates the resolver.tree function to match the spec and make the
option parameter optional.

Fixes #4
  • Loading branch information
garrensmith authored and vmx committed Mar 27, 2018
1 parent 5bc369b commit 2903bf7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ module.exports = {
})
},
tree: (binaryBlob, options, callback) => {
if (typeof options === 'function') {
callback = options
}
callback(null, [])
}
},
Expand Down
8 changes: 8 additions & 0 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,12 @@ describe('raw codec', () => {
expect(paths.length).to.eql(0)
})
})

it('resolver.tree option parameter can be ignored', () => {
resolver.tree(testBlob, (err, paths) => {
expect(err).to.not.exist()
expect(Array.isArray(paths)).to.eql(true)
expect(paths.length).to.eql(0)
})
})
})

0 comments on commit 2903bf7

Please sign in to comment.