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

Commit 4ad1ee4

Browse files
committed
fix: error if loadFormat() is not a function
Previously it was only erroring when it was undefined.
1 parent 54e8355 commit 4ad1ee4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class IPLDResolver {
2525
// Object with current list of active resolvers
2626
this.resolvers = {}
2727

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

0 commit comments

Comments
 (0)