Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 1a73160

Browse files
authoredApr 1, 2022
fix(rmlink): fix rmlink to match docs (#4073)
1 parent c51b160 commit 1a73160

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed
 

‎docs/core-api/OBJECT.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,9 @@ An optional object which may have the following keys:
398398
```JavaScript
399399
// cid is CID of the DAG node created by removing a link
400400
const cid = await ipfs.object.patch.rmLink(node, {
401-
name: 'some-link',
402-
size: 10,
403-
cid: CID.parse('QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD')
401+
Name: 'some-link',
402+
Tsize: 10,
403+
Hash: CID.parse('QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD')
404404
})
405405
```
406406

‎packages/ipfs-core/src/components/object/patch/rm-link.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export function createRmLink ({ repo, preload }) {
1414
/**
1515
* @type {import('ipfs-core-types/src/object/patch').API<{}>["rmLink"]}
1616
*/
17-
async function rmLink (multihash, linkRef, options = {}) {
18-
const node = await get(multihash, options)
19-
const name = (typeof linkRef === 'string' ? linkRef : linkRef.Name) || ''
17+
async function rmLink (cid, link, options = {}) {
18+
const node = await get(cid, options)
19+
const name = (typeof link === 'string' ? link : link.Name) || ''
2020

2121
node.Links = node.Links.filter(l => l.Name !== name)
2222

0 commit comments

Comments
 (0)
This repository has been archived.