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

Commit

Permalink
fix: handle required options for IPLDResolver.put
Browse files Browse the repository at this point in the history
  • Loading branch information
JonKrone authored and vmx committed Mar 26, 2018
1 parent c2ea74b commit 3612289
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ class IPLDResolver {

put (node, options, callback) {
if (typeof options === 'function') {
return setImmediate(() => callback(new Error('no options were passed')))
callback = options
return setImmediate(() => callback(
new Error('IPLDResolver.put requires options')
))
}
callback = callback || noop

Expand Down

0 comments on commit 3612289

Please sign in to comment.