You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
775 B
24 lines
775 B
5 months ago
|
/**
|
||
|
* 集合分组统计,返回各组中对象的数量统计
|
||
|
* @param list 对象
|
||
|
* @param iterate 回调/属性
|
||
|
* @param context 上下文
|
||
|
*/
|
||
|
export declare function countBy<T, C>(list: T[], iterate: string | number | ((this: C, item: T, index: number, list: T[]) => string | number), context?: C): { [key: string]: number };
|
||
|
|
||
|
/**
|
||
|
* 集合分组统计,返回各组中对象的数量统计
|
||
|
* @param obj 对象
|
||
|
* @param iterate 回调/属性
|
||
|
* @param context 上下文
|
||
|
*/
|
||
|
export declare function countBy<T, C>(obj: T, iterate: string | number | ((this: C, item: any, key: string, obj: T) => string | number), context?: C): { [key: string]: number };
|
||
|
|
||
|
declare module './ctor' {
|
||
|
interface XEUtilsMethods {
|
||
|
countBy: typeof countBy;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default countBy
|