Socket
Socket
Sign inDemoInstall

ultimate-pagination

Package Overview
Dependencies
0
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.2.0

20

dist/ultimate-pagination.js

@@ -71,7 +71,14 @@ (function webpackUniversalModuleDefinition(root, factory) {

// Calculate group of central pages
var mainPagesStart = Math.max(currentPage - 1, 2) - Math.max(0, currentPage + 2 - totalPages);
var mainPagesEnd = Math.min(currentPage + 1, totalPages - 1) + Math.max(0, 3 - currentPage);
var mainPages = (0, _ultimatePaginationUtils.createRange)(mainPagesStart, mainPagesEnd);
// Always add the first page
paginationModel.push(1);
// Show '...' between the first page and main pages group if needed
if (currentPage > 3) {
// Show '...' or second page between the last page and main pages group if needed
if (mainPagesStart === 3) {
paginationModel.push(2);
} else if (mainPagesStart > 3) {
paginationModel.push('...');

@@ -81,9 +88,8 @@ }

// Add pages +/- from the current page
var mainPagesStart = Math.max(currentPage - 1, 2);
var mainPagesEnd = Math.min(currentPage + 1, totalPages - 1);
var mainPages = (0, _ultimatePaginationUtils.createRange)(mainPagesStart, mainPagesEnd);
paginationModel.push.apply(paginationModel, _toConsumableArray(mainPages));
// Show '...' between main pages group and the last page if needed
if (currentPage < totalPages - 2) {
// Show '...' or penult page between main pages group and the last page if needed
if (mainPagesEnd === totalPages - 2) {
paginationModel.push(totalPages - 1);
} else if (mainPagesEnd < totalPages - 2) {
paginationModel.push('...');

@@ -90,0 +96,0 @@ }

{
"name": "ultimate-pagination",
"version": "0.1.0",
"version": "0.2.0",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/ultimate-pagination.js",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc