Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dcf9898

Browse files
author
GitHub Actions
committed
fix(paginator): last page now correctly matches rex
1 parent 884fc90 commit dcf9898

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎src/helpers.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ export function getNextPage(links: PaginationLink[]): string | null {
3737
const last = links.find((l) => l.rel === 'last');
3838
if (!next || !last) return null;
3939
const matchNext = next.uri.match(/page=([0-9]*)/);
40-
const matchLast = next.uri.match(/page=([0-9]*)/);
41-
40+
const matchLast = last.uri.match(/page=([0-9]*)/);
4241
if (!matchNext || !matchLast) return null;
4342
if (matchNext[1] === matchLast[1]) return null;
4443
return matchNext[1];

0 commit comments

Comments
 (0)