style: format with new style

This commit is contained in:
taskylizard
2024-01-25 16:32:45 +00:00
parent bc3bbaafeb
commit ef422dcda8
43 changed files with 686 additions and 583 deletions

View File

@@ -1,9 +1,12 @@
export function groupBy<T, K extends keyof any>(arr: T[], key: (i: T) => K): Record<K, T[]> {
export function groupBy<T, K extends keyof any>(
arr: T[],
key: (i: T) => K
): Record<K, T[]> {
return arr.reduce(
(groups, item) => {
(groups[key(item)] ||= []).push(item);
return groups;
;(groups[key(item)] ||= []).push(item)
return groups
},
{} as Record<K, T[]>,
);
{} as Record<K, T[]>
)
}