From 5227acb2876f97ccf041bfe6f4c63622294b003e Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 11 Sep 2023 14:01:31 -0400 Subject: [PATCH] fix: cid is a CID instance already --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index d63ec29..ec52e99 100644 --- a/src/index.ts +++ b/src/index.ts @@ -107,7 +107,7 @@ maybeInitDefaultPortals(); const fd = await fs.open(file as string); -let cid; +let cid: CID; try { cid = await uploadObject( @@ -178,7 +178,7 @@ await peerDefer.promise; let newEntry; try { - newEntry = CID.decode(cid).toRegistryEntry(); + newEntry = cid.toRegistryEntry(); } catch (e) { console.error("Failed to publish: ", e.message); process.exit();