You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2021. It is now read-only.
It's useful to be able to get the format implementations out of ipld
just before `ipld.put` operations in the HTTP API server of IPFS.
This is because we've serialized the node on the client for transmission
over HTTP so need to deserialize it before passing it into `ipld.put`
for it to be serialized (and as such, verified) again.
We can duplicate the list of resolvers and logic behind the addition
of new resolvers from ipld or we can just expose the `getFormat` function
which we do here to reduce any code duplication.
@@ -284,6 +285,13 @@ Returns an async iterator of all the paths (as Strings) you could resolve into.
284
285
285
286
Returns the IPLD instance. This way you can chain `addFormat()` calls.
286
287
288
+
### `.getFormat(codec)`
289
+
290
+
> Return the implementation for an IPLD Format
291
+
292
+
-`codec` (`multicodec`, required): the codec of the IPLD Format to return the implementation from.
293
+
294
+
If the implementation is not present in the current list of resolvers, the `loadFormat` function passed as an option to the constructor of this module will be invoked and it's output added to the list of available resolvers.
0 commit comments