pagination-generator
Advanced tools
Comparing version 1.0.1 to 1.0.2
18
index.js
@@ -21,3 +21,3 @@ "use strict"; | ||
current = Math.min(total, Math.max(1, current)); | ||
let first = { | ||
var first = { | ||
type: "nav", | ||
@@ -28,3 +28,3 @@ name: "first", | ||
}; | ||
let last = { | ||
var last = { | ||
type: "nav", | ||
@@ -35,3 +35,3 @@ name: "last", | ||
}; | ||
let prev = { | ||
var prev = { | ||
type: "nav", | ||
@@ -42,3 +42,3 @@ name: "prev", | ||
}; | ||
let next = { | ||
var next = { | ||
type: "nav", | ||
@@ -61,4 +61,4 @@ name: "next", | ||
} | ||
let start = 1, end = total; | ||
let before = [], after = []; | ||
var start = 1, end = total; | ||
var before = [], after = []; | ||
if (total > limit) { | ||
@@ -68,3 +68,3 @@ before = [first, prev]; | ||
limit -= 4; | ||
let half = Math.floor(limit / 2); | ||
var half = Math.floor(limit / 2); | ||
if (current <= half) { | ||
@@ -79,4 +79,4 @@ end = limit; | ||
} | ||
let pages = []; | ||
for (let i = start; i <= end; i++) { | ||
var pages = []; | ||
for (var i = start; i <= end; i++) { | ||
pages.push({ | ||
@@ -83,0 +83,0 @@ type: "num", |
{ | ||
"name": "pagination-generator", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "pagination generator", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |