From 474789ee92030f4ca221f307deedd29ef044c17a Mon Sep 17 00:00:00 2001 From: sandro768 Date: Tue, 6 Jun 2023 17:59:30 +0200 Subject: [PATCH] adds isBranch property to flattenTree function --- src/TreeView/utils.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/TreeView/utils.ts b/src/TreeView/utils.ts index 09dc9edb..b867d5d1 100644 --- a/src/TreeView/utils.ts +++ b/src/TreeView/utils.ts @@ -288,6 +288,7 @@ interface ITreeNode { id?: NodeId; name: string; children?: ITreeNode[]; + isBranch?: boolean; } export const flattenTree = function(tree: ITreeNode): INode[] { @@ -299,6 +300,7 @@ export const flattenTree = function(tree: ITreeNode): INode[] { id: tree.id || internalCount, name: tree.name, children: [], + ...(tree.isBranch && { isBranch: tree.isBranch }), parent, };