Private
Readonly
childrenName of property where child nodes are stored (default value is children
)
Private
Readonly
idName of unique identifier property in nodes (default value is id
)
Private
Readonly
parentName of parent identifier property in nodes (default value is parentId
)
Method to update node by id with given data in tree (mutable operation!)
tree structure for node editing
identifier of node to be updated
new data of node (you should also pass children if you want to keep it)
Method to find all nodes in tree structure by given callback function
all found nodes
utils.findAllTreeNodes(tree, item => item.id === myId);
tree structure to search in
callback function to find all nodes
Method to find node in tree structure by given callback function
found node
utils.findTreeNode(tree, item => item.id === myId);
tree structure to search in
callback function to find node
Private
getConvert list to tree like structure
list of objects, objects need to have id (as you configured, or 'id' by default) and parentId property (as you configured, or 'parentId' by default)
id of parent node
Convert tree like structure to list
tree of objects, objects need to have children (as you configured, or 'children' by default) and parentId property (as you configured, or 'parentId' by default)
Static
Private
deepGenerated using TypeDoc
Class to transform and manipulate tree like structures