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

fix: allow adding links from DAGNode.Links #135

Merged
merged 1 commit into from
May 17, 2019

Conversation

achingbrain
Copy link
Member

DAGNode.Links converts DAGLink objects into vanilla JS objects. DAGNode.addLink accepts vanilla JS objects as links but looks for different properties from the ones the return value of DAGNode.Links have (e.g. .Hash vs .cid, etc)..

This PR corrects the behaviour to look for those properties names and adds a test for the same.

`DAGNode.Links` converts `DAGLink` objects into vanilla JS objects.
`DAGNode.addLink` accepts vanilla JS objects as links but looks for
different properties from the ones the return value of `DAGNode.Links`
have (e.g. `.Hash` vs `.cid`, etc)..

This PR corrects the behaviour to look for those properties names and
adds a test.
@achingbrain achingbrain requested a review from vmx May 16, 2019 21:03
@ghost ghost assigned achingbrain May 16, 2019
@ghost ghost added the status/in-progress In progress label May 16, 2019
@codecov
Copy link

codecov bot commented May 16, 2019

Codecov Report

Merging #135 into master will increase coverage by 0.42%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #135      +/-   ##
==========================================
+ Coverage   94.11%   94.53%   +0.42%     
==========================================
  Files          15       15              
  Lines         238      238              
==========================================
+ Hits          224      225       +1     
+ Misses         14       13       -1
Impacted Files Coverage Δ
src/dag-node/addLink.js 100% <100%> (ø) ⬆️
src/dag-node/util.js 100% <0%> (+5.55%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfc97f9...bfe2b78. Read the comment docs.

@vmx vmx merged commit a5d300f into master May 17, 2019
@vmx vmx deleted the allow-adding-links-from-accessor branch May 17, 2019 22:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants