• 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 (TItem & {
        children: TItem[];
    })[]