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

Commit

Permalink
fix: add dynamically loaded format via addFormat()
Browse files Browse the repository at this point in the history
The return value of `loadFormat()` needs to have the same type as the
format you pass in via `addFormat()`. Hence use the `addFormat()` code
path in order to add a new format dynamically.
  • Loading branch information
vmx committed Mar 21, 2019
1 parent 4ad1ee4 commit 95536cd
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 @@ -455,7 +455,7 @@ class IPLDResolver {

// If not supported, attempt to dynamically load this format
const format = await this.loadFormat(codec)
this.resolvers[codec] = format
this.addFormat(format)
return format
}

Expand Down

0 comments on commit 95536cd

Please sign in to comment.