Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bazhe/paginator

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bazhe/paginator - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"name": "@bazhe/paginator",
"version": "1.0.3",
"version": "1.0.4",
"description": "Pagination utilties for handling pagination logic",

@@ -5,0 +5,0 @@ "author": "Blagoj Petrov",

@@ -15,4 +15,2 @@ # @bazhe/paginator

Say what the step will be
npm

@@ -43,4 +41,2 @@

<!-- TODO ADD LINK TO paginationOptions -->
**generatePaginator** accepts paginationOptions as argument

@@ -74,4 +70,15 @@

### Pagination Options
API for:
- generatePaginator(**paginationOptions**)
- new Paginator(perPage, links)
### Parameters
#### generatePaginator(**paginationOptions**):
<br/>
**Pagination Options**
| Name | Type | Default | Description |

@@ -87,4 +94,17 @@ | ------------ | ------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------ |

### Pagination Return
#### Paginator
| Name | Type | Description |
| ------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| constructor(perPage: number, links: number) | | The constructor that creates paginator object. Example: new Paginator(4, 10) |
| build | \<T>(total_results: number, current_page?: number, items?: T[]) => PaginationResult | The main methods that returns the fully expected pagination result |
| getFirstPage | (currentPage: number) => number | Gets first page, depending on the number of links (ex. buttons displayed in the pagination bar) |
| getLastPage | (currentPage: number) => number | Gets last page, depending on the number of links (ex. buttons displayed in the pagination bar) |
| getFirstResult | (currentPage: number) => number | Gets first result/index, depending on the limit/perPage and current page |
| getLastResult | (currentPage: number) => number | Gets last result/index, depending on the limit/perPage and current page |
### Pagination Result/Return
The result from generatePaginator or Paginator.build:
| Name | Type | Description |

@@ -91,0 +111,0 @@ | ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------- |

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc