@pleisto/active-support
    Preparing search index...

    Function array2Tree

    • Converts an array of items with ids and parent ids to a nested tree in a performant way (time complexity O(n)).

      Type Parameters

      • TItem extends Item

      Parameters

      • items: TItem[]

        array of items

      • config: Partial<Config> = {}

        please see performant-array-to-tree

      Returns ({ children: TItem[] } & TItem)[]