Function toMapTree

  • Creates N-level grouping of items using given grouping selector in the order provided.

    Type Parameters

    • V

    Parameters

    • items: V[]

      array of items to groups

    • grouping: (v: V) => string[]

      array of selectors

    Returns MapTree<string, V>

    a Map of Map ... of Map<string, item> with the first map containing a single element called root.