• Find the key for all nodes

    Example

    import { findAllKeys } from "tree-handle-lib";
    const node = [{
    key: "A",
    children: [{ key: "AA", children: [{ key: "AAA" }] }, { key: "AB" }],
    }];
    const _result = findAllKeys(node);
    // ["A", "AA", "AB", "AAA"];

    Parameters

    • node: TNode

      the root node of the tree, can be a single node or an array of nodes

    • childrenName: string = CHILDREN_NAME

      the child key name of the child node in the tree structure, default value is CHILDREN_NAME='children'

    • keyName: string = KEY_NAME

      the key name of the node in the tree structure, default value is KEY_NAME='key'

    Returns string[]

    node | null

Generated using TypeDoc