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

Commit 95536cd

Browse files
committed
fix: add dynamically loaded format via addFormat()
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.
1 parent 4ad1ee4 commit 95536cd

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
@@ -455,7 +455,7 @@ class IPLDResolver {
455455

456456
// If not supported, attempt to dynamically load this format
457457
const format = await this.loadFormat(codec)
458-
this.resolvers[codec] = format
458+
this.addFormat(format)
459459
return format
460460
}
461461

0 commit comments

Comments
 (0)