@supuwoerc/toolkit
    Preparing search index...

    Function tree2Array

    • 将树结构扁平化为数组

      Flatten a tree structure into an array.

      Type Parameters

      Parameters

      • tree: Tree<T, "children">[]

        输入的树数组 / input tree array

      • OptionalchildrenKey: keyof T = ...

        子节点字段名 / children field name

      Returns T[]

      扁平化后的数组 / flattened array

      // tree2Array(tree)