ltxmlts
    Preparing search index...

    Function groupBy

    • Groups the items by a key derived from each item.

      Type Parameters

      • T extends XNode | XAttribute

        The element type.

      • K

        The type of the grouping key.

      Parameters

      • items: T[]

        The items to group.

      • keySelector: (item: T) => K

        A function that returns the grouping key for each item.

      Returns Map<K, XSequence<T>>

      A map from each key to an XSequence of its matching items.