pagination-utils
v4.60.0
Published
> A collection of pagination related utilities.
Downloads
2
Readme
@deque/pagination-utils
A collection of pagination related utilities.
Installation
npm install @deque/pagination-utils --registry=http://agora.dequecloud.com/artifactory/api/npm/dequelabs
API
utils.Headers
(enum)
An enum
of the supported HTTP headers used for pagination.
utils.Pagination
(type)
A TypeScript interface describing paginated metadata.
utils.Paginated<T>
(type)
A TypeScript utility type for a paginated data.
utils.getPagination(data): Pagination
Get pagination metadata from data
.
utils.setPagination<T>(data: T, pagination): Paginated<T>
Add pagination
metadata to data
.
utils.setResponseHeaders(res, pagination)
Set pagination
headers on the given res
.
utils.parseRequestHeaders(req)
Parse pagination headers from the given req
.