From 1a73160e5dbe8623458cdf1194158c2f45ff64a6 Mon Sep 17 00:00:00 2001 From: Caleb Mabry <36182383+caleb-mabry@users.noreply.github.com> Date: Fri, 1 Apr 2022 10:04:52 -0400 Subject: [PATCH] fix(rmlink): fix rmlink to match docs (#4073) --- docs/core-api/OBJECT.md | 6 +++--- packages/ipfs-core/src/components/object/patch/rm-link.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/core-api/OBJECT.md b/docs/core-api/OBJECT.md index c960b95e6b..3d5667e3d6 100644 --- a/docs/core-api/OBJECT.md +++ b/docs/core-api/OBJECT.md @@ -398,9 +398,9 @@ An optional object which may have the following keys: ```JavaScript // cid is CID of the DAG node created by removing a link const cid = await ipfs.object.patch.rmLink(node, { - name: 'some-link', - size: 10, - cid: CID.parse('QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD') + Name: 'some-link', + Tsize: 10, + Hash: CID.parse('QmPTkMuuL6PD8L2SwTwbcs1NPg14U8mRzerB1ZrrBrkSDD') }) ``` diff --git a/packages/ipfs-core/src/components/object/patch/rm-link.js b/packages/ipfs-core/src/components/object/patch/rm-link.js index 1408d95d10..bc076da966 100644 --- a/packages/ipfs-core/src/components/object/patch/rm-link.js +++ b/packages/ipfs-core/src/components/object/patch/rm-link.js @@ -14,9 +14,9 @@ export function createRmLink ({ repo, preload }) { /** * @type {import('ipfs-core-types/src/object/patch').API<{}>["rmLink"]} */ - async function rmLink (multihash, linkRef, options = {}) { - const node = await get(multihash, options) - const name = (typeof linkRef === 'string' ? linkRef : linkRef.Name) || '' + async function rmLink (cid, link, options = {}) { + const node = await get(cid, options) + const name = (typeof link === 'string' ? link : link.Name) || '' node.Links = node.Links.filter(l => l.Name !== name)