This repository has been archived by the owner on Aug 11, 2021. It is now read-only.
v0.18.0
Bug Fixes
Features
- make addLink()/rmLink() instance methods (a9aa0a0)
- remove cloning (d5e1135)
- remove DAGNode.create() (029174d), closes #132
Performance Improvements
- remove manual enumerability modifications (37ffdd5), closes #152
- remove named links from object (4dbe00d)
BREAKING CHANGES
addLink()
andrmLink()
are now instance methods.
Prior to this change:
DAGNode.addLink(node, link)
DAGNode.rmLink(node, name)
Now:
node.addLink(link)
node.rmLink(name)
- It's no longer possible to pass a
DAGNode
intoaddLink()
.
Intead of passing in a DAGNode
into addLink()
, convert that node into
a DAGLink
via toDAGLink()
.
Example:
Prior to this change:
const node = new DAGNode('some data')
const node2 = new DAGNode('use that as link')
await DAGNode.addLink(node, node2)
Now:
const node = new DAGNode('some data')
const node2 = new DAGNode('use that as link')
DAGNode.addLink(node, await node2.toDAGLink())
- DAGNode.create() is removed
Instead of DAGNode.create()
, please use new DAGNode()
instead. It
takes the same parameters and is compatible to create()
.
Example:
Prior to this change:
const node = DAGNode.create('some data', links)
Now:
const node = new DAGNode('some data', links)
DAGNode.clone()
is removed from public API without any replacement.
Also the API for rmLink()
and addLink()
changed. They no longer
return a new node, but just remove/add the links to/from the current
node.
Prior to this change:
const lessLinks = DAGNode.rmLink(node1, 'Link1')
node1 = lessLinks
const moreLinks = await DAGNode.addLink(node2, link)
node2 = moreLinks
Now:
DAGNode.rmLink(node, 'Link1')
await DAGNode.addLink(node2, link)
- named links are no longer part of an object
Access to named links is only possible with calling resolve()
.
Hence they are also not part of tree()
anymore.
Named links are a feature of IPFS and only supported for
backwards compatibility, they are not really part of IPLD.