Function rollups

  • Equivalent to rollup, but returns nested arrays instead of nested maps.

    Type Parameters

    • TObject

    • TReduce

    • TKeys extends unknown[]

    Parameters

    • iterable: Iterable<TObject>

      The iterable to group.

    • reduce: ((values) => TReduce)

      The reduce function.

        • (values): TReduce
        • Parameters

          • values: TObject[]

          Returns TReduce

    • Rest ...keys: {
          [Index in string | number | symbol]: ((value, index, values) => TKeys[Index])
      }

      The key functions.

    Returns NestedArray<TObject, TReduce, TKeys>