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

Commit

Permalink
fix: error if loadFormat() is not a function
Browse files Browse the repository at this point in the history
Previously it was only erroring when it was undefined.
  • Loading branch information
vmx committed Mar 21, 2019
1 parent 54e8355 commit 4ad1ee4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class IPLDResolver {
// Object with current list of active resolvers
this.resolvers = {}

if (options.loadFormat === undefined) {
if (typeof options.loadFormat !== 'function') {
this.loadFormat = async (codec) => {
const codecName = multicodec.print[codec]
throw new Error(`No resolver found for codec "${codecName}"`)
Expand Down

0 comments on commit 4ad1ee4

Please sign in to comment.