Spaces:
Configuration error
Configuration error
Download frontend/src/utils/extract-next-page-from-link.ts from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 405 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/utils/extract-next-page-from-link.ts
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/utils/extract-next-page-from-link.ts
-
curl -L -o extract-next-page-from-link.ts https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/utils/extract-next-page-from-link.ts
405 Bytes
| /** | |
| * Extracts the next page number from a GitHub API link header. | |
| * @param link The GitHub API link header | |
| * @returns The next page number or null if there is no next page | |
| */ | |
| export const extractNextPageFromLink = (link: string): number | null => { | |
| const regex = /<[^>]*[?&]page=(\d+)(?:&[^>]*)?>; rel="next"/; | |
| const match = link.match(regex); | |
| return match ? parseInt(match[1], 10) : null; | |
| }; | |