From ebb04e548c2286d61b8835dcbddd90eb5761b723 Mon Sep 17 00:00:00 2001 From: PJ Date: Wed, 16 Feb 2022 12:31:59 +0100 Subject: [PATCH] Add logging --- packages/ipfs-api/src/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/ipfs-api/src/utils.ts b/packages/ipfs-api/src/utils.ts index 13722d20..612cfc27 100644 --- a/packages/ipfs-api/src/utils.ts +++ b/packages/ipfs-api/src/utils.ts @@ -18,7 +18,9 @@ export async function isDirectory(cid: string): Promise { // TODO: terribly hacky but needed quick fix, it turns out files now contain // multiple link objects as well so this method of checking whether it's a // directory or not is not as great as it used to be - return (json["Links"].length && json["Links"][0] && json["Links"][0]["Name"] && json["Links"][0]["Name"] !== "") + const isDir = (json["Links"].length && json["Links"][0] && json["Links"][0]["Name"] && json["Links"][0]["Name"] !== "") + console.log("Links", json["Links"]) + return isDir } export async function download(cid: string, destination: string, directory: boolean): Promise {