• 查找指定元素

    Parameters

    • node: TreeNode[]

      源数组

    • fn: Function

      过滤函数

    Returns TreeNode | undefined

    查找到的目标节点

    Example

    const tree = [{ id: '1', children: [{ id: '2', children: [] }] }];
    const result = deepFind(tree, node => node.id === '2');
    // 返回 { id: '2', children: [] }

Generated using TypeDoc