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

Commit 5f62fe0

Browse files
committed
feat: make addFormat() and removeFormat() return the instance
This way you can chain addFormat()/removeFormat() calls.
1 parent 95536cd commit 5f62fe0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class IPLDResolver {
4444
* Add support for an IPLD Format.
4545
*
4646
* @param {Object} format - The implementation of an IPLD Format.
47-
* @returns {void}
47+
* @returns {this}
4848
*/
4949
addFormat (format) {
5050
// IPLD Formats are using strings instead of constants for the multicodec
@@ -59,18 +59,22 @@ class IPLDResolver {
5959
resolver: format.resolver,
6060
util: format.util
6161
}
62+
63+
return this
6264
}
6365

6466
/**
6567
* Remove support for an IPLD Format.
6668
*
6769
* @param {number} codec - The codec of the IPLD Format to remove.
68-
* @returns {void}
70+
* @returns {this}
6971
*/
7072
removeFormat (codec) {
7173
if (this.resolvers[codec]) {
7274
delete this.resolvers[codec]
7375
}
76+
77+
return this
7478
}
7579

7680
/**

0 commit comments

Comments
 (0)