Skip to content

Commit

Permalink
fix(repository): fix bug in splitByPageSize
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos committed Jul 8, 2019
1 parent 672698d commit 7a83161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/repository/src/relations/relation.helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function splitByPageSize<T>(items: T[], pageSize: number): T[][] {
if (pageSize < 0) return [items];
if (!pageSize) throw new Error(`Invalid page size: ${pageSize}`);
const pages: T[][] = [];
for (let i = 0; i < pages.length; i += pageSize) {
for (let i = 0; i < items.length; i += pageSize) {
pages.push(items.slice(i, i + pageSize));
}
return pages;
Expand Down

0 comments on commit 7a83161

Please sign in to comment.