From 4ad1ee4532566234ccd4f4172bc5d6d15be29158 Mon Sep 17 00:00:00 2001 From: Volker Mische Date: Wed, 20 Feb 2019 16:37:22 +0100 Subject: [PATCH] fix: error if loadFormat() is not a function Previously it was only erroring when it was undefined. --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 2fcf8b6..6965f87 100644 --- a/src/index.js +++ b/src/index.js @@ -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}"`)