@pleisto/active-support
    Preparing search index...

    Variable groupConst

    group: <T, Key extends string | number | symbol>(
        array: readonly T[],
        getGroupId: (item: T) => Key,
    ) => Partial<Record<Key, T[]>>

    Sorts an array of items into groups. The return value is a map where the keys are the group ids the given getGroupId function produced and the value is an array of each item in that group.

    Type declaration

      • <T, Key extends string | number | symbol>(
            array: readonly T[],
            getGroupId: (item: T) => Key,
        ): Partial<Record<Key, T[]>>
      • Type Parameters

        • T
        • Key extends string | number | symbol

        Parameters

        • array: readonly T[]
        • getGroupId: (item: T) => Key

        Returns Partial<Record<Key, T[]>>