Skip to content

Commit

Permalink
fix #76
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanPB committed May 13, 2022
1 parent a88cd87 commit fff4623
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/array/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function chunkedByCount<T>(array: T[], count: number) : T[][] {
}

export function chunkedBySize<T>(array: T[], size: number) : T[][] {
const buckedSize = Math.min(array.length / size)
const buckedSize = Math.ceil(array.length / size)
return array.reduce((buff, it, index) => {
const chunkIndex = index % buckedSize
const chunk = [ ...(buff[chunkIndex] ?? []), it ]
Expand Down

0 comments on commit fff4623

Please sign in to comment.