@mudssky/jsutils
    Preparing search index...

    Function countBy

    • 计数,根据生成的key值来统计

      Type Parameters

      • T
      • TId extends string | number | symbol

      Parameters

      • list: readonly T[]

        要统计的数组

      • identity: (item: T) => TId

        生成key的函数

      Returns Record<TId, number>

      统计结果对象