From 1631e11e4f925de9d410fea0fcdf267158c6866d Mon Sep 17 00:00:00 2001 From: syedsalehinipg Date: Wed, 14 Feb 2024 12:31:06 +0000 Subject: [PATCH] updated comments --- src/TreeViewList/TreeViewList.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/TreeViewList/TreeViewList.tsx b/src/TreeViewList/TreeViewList.tsx index 6c99a493..dcf60571 100644 --- a/src/TreeViewList/TreeViewList.tsx +++ b/src/TreeViewList/TreeViewList.tsx @@ -147,7 +147,13 @@ const TooltipTreeItem = ( ); }; -// function to filter the items to contain only those that match the search term +/** + * Filter items to contain only those that match the searchTerm + * @param items - The items to filter. + * @param searchTerm - The search term to match. + * @returns The filtered items. + * @example filterBySearchTerm(items, "search term"); + */ const filterBySearchTerm = (items: TreeNodeItem[], searchTerm: string) => { // take a copy of the items array to avoid mutating the original const itemsCopy = JSON.parse(JSON.stringify(items)) as TreeNodeItem[];