IFClite TypeScript API
    Preparing search index...

    Function foldGroups

    • Keep the max - 1 largest groups by magnitude, in their given order, and fold the rest into other(rest).

      Type Parameters

      • G extends { value: number }

      Parameters

      • groups: readonly G[]
      • max: number
      • other: (rest: G[]) => G

      Returns G[]