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
838 B
24 lines
838 B
5 months ago
|
/**
|
||
|
* 集合分组,默认使用键值分组,如果有 iterate 则使用结果进行分组
|
||
|
* @param list 对象
|
||
|
* @param iterate 回调/对象属性
|
||
|
* @param context 上下文
|
||
|
*/
|
||
|
export declare function groupBy<T, C>(list: T[], iterate: string | number | ((this: C, item: T, index: number, obj: T[]) => string | number), context?: C): { [key: string]: T[] };
|
||
|
|
||
|
/**
|
||
|
* 集合分组,默认使用键值分组,如果有 iterate 则使用结果进行分组
|
||
|
* @param obj 对象
|
||
|
* @param iterate 回调/对象属性
|
||
|
* @param context 上下文
|
||
|
*/
|
||
|
export declare function groupBy<T, C>(obj: T, iterate: string | number | ((this: C, item: any, key: string, obj: T) => string | number), context?: C): { [key: string]: any[] };
|
||
|
|
||
|
declare module './ctor' {
|
||
|
interface XEUtilsMethods {
|
||
|
groupBy: typeof groupBy;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default groupBy
|