feat: upgrade prettier to v3

This commit is contained in:
Thea Schöbl
2023-12-05 10:36:04 +00:00
parent 991ed1cb1f
commit 31a6ebfd3f
50 changed files with 455 additions and 362 deletions

View File

@@ -20,8 +20,11 @@
* iteratee is invoked with one argument: (value).
*/
export function keyBy<T>(collection: T[], key: (item: T) => string | number): Record<string, T> {
return collection.reduce((accumulator, item) => {
accumulator[key(item)] = item;
return accumulator;
}, {} as Record<string | number, T>);
return collection.reduce(
(accumulator, item) => {
accumulator[key(item)] = item;
return accumulator;
},
{} as Record<string | number, T>,
);
}