Skip to content

feat: add generic paginateArray helper to horizonPaginator (Closes #618) - #623

Open
waterWang wants to merge 1 commit into
Stellar-split:mainfrom
waterWang:feat/618-paginate-array
Open

feat: add generic paginateArray helper to horizonPaginator (Closes #618)#623
waterWang wants to merge 1 commit into
Stellar-split:mainfrom
waterWang:feat/618-paginate-array

Conversation

@waterWang

Copy link
Copy Markdown

Summary

Adds a generic paginateArray helper to horizonPaginator for in-memory array pagination.

Changes

  • src/horizonPaginator.ts: Added paginateArray<T>() function that paginates a plain array with 1-indexed pages, pageSize validation (1-200), and full pagination metadata (data, total, totalPages, hasNext, hasPrev).
  • src/index.ts: Exported paginateArray from the package entry point.
  • test/paginateArray.test.ts: 11 unit tests covering first/last/middle pages, out-of-range pages, single item, exact pageSize, empty array, pageSize boundary validation, and pagination metadata correctness.

Closes

Closes #618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add generic paginateArray helper to horizonPaginator

1 participant