Compares two trees for the same node key
import { isEqualTreeNode } from "tree-handle-lib";const tree1 = [ { key: "1", name: "Node 1", children: [ { key: "2", name: "Node 2", }, { key: "3", name: "Node 3", }, ], }, ]; const tree2 = [ { key: "1", name: "Node 1", children: [ { key: "2", name: "Node 2", }, { key: "3", name: "Node 3", }, ], }, ];const _result= isEqualTreeNode(tree1, tree2)// true Copy
import { isEqualTreeNode } from "tree-handle-lib";const tree1 = [ { key: "1", name: "Node 1", children: [ { key: "2", name: "Node 2", }, { key: "3", name: "Node 3", }, ], }, ]; const tree2 = [ { key: "1", name: "Node 1", children: [ { key: "2", name: "Node 2", }, { key: "3", name: "Node 3", }, ], }, ];const _result= isEqualTreeNode(tree1, tree2)// true
one of the tree node
the other tree node
the child key name of the child node in the tree structure,default value is CHILDREN_NAME='children'
the key name of the node in the tree structure,default value is KEY_NAME='key'
Generated using TypeDoc
Compares two trees for the same node key
Example