Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit b6bce33

Browse files
achingbrainAlan Shaw
authored and
Alan Shaw
committed
chore: update ipld formats
Updates property names to the various ways we refer to links and data in DAGNode/DAGLinks
1 parent 4ac98b3 commit b6bce33

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"glob": "^7.1.3",
4242
"ipfs-block": "~0.8.1",
4343
"ipld-dag-cbor": "~0.15.0",
44-
"ipld-dag-pb": "~0.17.1",
44+
"ipld-dag-pb": "ipld/js-ipld-dag-pb#support-size-property",
4545
"is-ipfs": "~0.6.1",
4646
"is-pull-stream": "0.0.0",
4747
"is-stream": "^2.0.0",
@@ -54,7 +54,7 @@
5454
"lru-cache": "^5.1.1",
5555
"multiaddr": "^6.0.6",
5656
"multibase": "~0.6.0",
57-
"multicodec": "~0.5.0",
57+
"multicodec": "~0.5.1",
5858
"multihashes": "~0.4.14",
5959
"ndjson": "github:hugomrdias/ndjson#feat/readable-stream3",
6060
"once": "^1.4.0",

src/object/addLink.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ module.exports = (send) => {
2121

2222
const args = [
2323
cid.toString(),
24-
dLink.name || dLink.Name || null,
25-
(dLink.cid || dLink.Hash || '').toString() || null
24+
dLink.Name || dLink.name || null,
25+
(dLink.Hash || dLink.cid || '').toString() || null
2626
]
2727

2828
send({ path: 'object/patch/add-link', args }, (err, result) => {

src/object/links.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ module.exports = (send) => {
4343
let links = []
4444

4545
if (result.Links) {
46-
links = result.Links.map((l) => new DAGLink(l.Name, l.Size, l.Hash))
46+
links = result.Links.map((l) => {
47+
return new DAGLink(l.Name, l.Size, l.Hash)
48+
})
4749
}
4850
callback(null, links)
4951
})

src/object/rmLink.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module.exports = (send) => {
2323
path: 'object/patch/rm-link',
2424
args: [
2525
cid.toString(),
26-
dLink.name || dLink.Name || null
26+
dLink.Name || dLink.name || null
2727
]
2828
}, (err, result) => {
2929
if (err) {

0 commit comments

Comments
 (0)