Function flatGroup

  • Equivalent to group, but returns a flat array of [key0, key1, …, values] instead of nested maps.

    Type Parameters

    • TObject

    • TKeys extends unknown[]

    Parameters

    • iterable: Iterable<TObject>

      The iterable to group.

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

      The key functions.

    Returns [...TKeys, TObject[]][]