Flarum (2.x)
    Preparing search index...
    • Splits an ordered list of entries into sections.

      An entry without a known section joins the section of the entry before it, so something added between two entries of a section (by priority) stays where it was shown before sections existed. Entries before the first sectioned one form a leading group with a null section.

      Type Parameters

      • T

      Parameters

      • entries: T[]

        The entries, in display order.

      • sectionOf: (entry: T) => string | null | undefined

        The section an entry declares, if any.

      • sections: string[]

        The known section ids, in display order.

      Returns SectionGroup<T>[]