@book000/pixivts - v0.61.1
    Preparing search index...

    Function parseNextUrl

    • Parses a pixiv next_url into a typed cursor object.

      Pass the next_url field from any paginated response to extract the cursor parameters needed to resume pagination from a saved position.

      Parameters

      • url: string

        The next_url string returned by a pixiv list endpoint

      Returns ParsedNextUrl

      Typed cursor parameters; fields absent in the URL are undefined

      const page = await client.users.bookmarks.illusts({ userId: client.userId })
      if (page.isOk && page.value.nextUrl) {
      const cursor = parseNextUrl(page.value.nextUrl)
      // Resume later:
      const next = await client.users.bookmarks.illusts({
      userId: client.userId,
      maxBookmarkId: cursor.maxBookmarkId,
      })
      }