ltxmlts
    Preparing search index...

    Function groupAdjacent

    • Groups adjacent items that share the same key into runs.

      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 { items: XSequence<T>; key: K }[]

      An array of objects, each containing a key and an XSequence of adjacent items with that key.