Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 884fc90 commit dcf9898Copy full SHA for dcf9898
1 file changed
‎src/helpers.ts‎
@@ -37,8 +37,7 @@ export function getNextPage(links: PaginationLink[]): string | null {
37
const last = links.find((l) => l.rel === 'last');
38
if (!next || !last) return null;
39
const matchNext = next.uri.match(/page=([0-9]*)/);
40
- const matchLast = next.uri.match(/page=([0-9]*)/);
41
-
+ const matchLast = last.uri.match(/page=([0-9]*)/);
42
if (!matchNext || !matchLast) return null;
43
if (matchNext[1] === matchLast[1]) return null;
44
return matchNext[1];
0 commit comments