From 348e95c3e13b1af8c0369a1c4c810bf0b1fe59fc Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 5 Jan 2023 15:09:58 +0100 Subject: [PATCH] chore: better tree debug print --- src/core/utils.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/utils.ts b/src/core/utils.ts index 3796799e..a57949a3 100644 --- a/src/core/utils.ts +++ b/src/core/utils.ts @@ -30,13 +30,15 @@ function printTree( const hasNext = index++ < total - 1 const { children } = child - treeStr += `${`${parentPre}${hasNext ? '├' : '└'}─ `}${child}\n` + treeStr += `${`${parentPre}${hasNext ? '├' : '└'}${ + '─' + (children.size > 0 ? '┬' : '') + } `}${child}\n` if (children) { treeStr += printTree( children, level + 1, - `${parentPre}${hasNext ? '│' : ' '} ` + `${parentPre}${hasNext ? '│' : ' '} ` ) } }