Skip to content

Commit

Permalink
fix: fixed group return type
Browse files Browse the repository at this point in the history
  • Loading branch information
gperdomor authored May 8, 2024
1 parent 069b26c commit b7a8801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { isArray, isFunction } from './typed'
export const group = <T, Key extends string | number | symbol>(
array: readonly T[],
getGroupId: (item: T) => Key
): Partial<Record<Key, T[]>> => {
): Record<Key, T[]> => {
return array.reduce((acc, item) => {
const groupId = getGroupId(item)
if (!acc[groupId]) acc[groupId] = []
Expand Down

0 comments on commit b7a8801

Please sign in to comment.