@visulima/pagination 5.0.0-alpha.7 → 5.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## @visulima/pagination [5.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/pagination@5.0.0-alpha.8...@visulima/pagination@5.0.0-alpha.9) (2026-04-08)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **pagination:** remove unnecessary Number() type conversions ([1393f87](https://github.com/visulima/visulima/commit/1393f8721e3824af7fdf59361ddd1e445bc2bff5))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* **api:** remove empty dependency objects from package.json ([f6bfc85](https://github.com/visulima/visulima/commit/f6bfc85c48c973ff8ea0a7db5951794ae0ea3efb))
|
|
10
|
+
* **pagination:** add tsconfig.eslint.json for type-aware linting ([d66266c](https://github.com/visulima/visulima/commit/d66266cf401e974d7dda3418228daa06d6ec7253))
|
|
11
|
+
* **pagination:** apply auto-fix formatting ([343ccc0](https://github.com/visulima/visulima/commit/343ccc01b8e398f11bd592f865dec6d04b3a8fca))
|
|
12
|
+
* **pagination:** apply prettier formatting ([8e4e960](https://github.com/visulima/visulima/commit/8e4e9609ac04bd3aee32ba8b73af49d995849fe2))
|
|
13
|
+
* **pagination:** migrate .prettierrc.cjs to prettier.config.js ([17c14e6](https://github.com/visulima/visulima/commit/17c14e69da0aa3beee75631cb33266fd41060e86))
|
|
14
|
+
|
|
15
|
+
## @visulima/pagination [5.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/pagination@5.0.0-alpha.7...@visulima/pagination@5.0.0-alpha.8) (2026-03-26)
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
|
|
20
|
+
|
|
21
|
+
### Miscellaneous Chores
|
|
22
|
+
|
|
23
|
+
* update homepage URLs to visulima.com/packages/ format ([be42968](https://github.com/visulima/visulima/commit/be42968129df85fb074224435e33135ff44cab91))
|
|
24
|
+
|
|
1
25
|
## @visulima/pagination [5.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/pagination@5.0.0-alpha.6...@visulima/pagination@5.0.0-alpha.7) (2026-03-26)
|
|
2
26
|
|
|
3
27
|
### Bug Fixes
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import Paginator from './packem_shared/Paginator-
|
|
1
|
+
import Paginator from './packem_shared/Paginator-D40bQfqD.js';
|
|
2
2
|
export { createPaginationMetaSchemaObject, createPaginationSchemaObject } from './packem_shared/createPaginationMetaSchemaObject-AoC1C8S-.js';
|
|
3
3
|
|
|
4
|
-
const paginate = (page, perPage, total, rows) => new Paginator(total,
|
|
4
|
+
const paginate = (page, perPage, total, rows) => new Paginator(total, perPage, page, ...rows);
|
|
5
5
|
|
|
6
6
|
export { Paginator, paginate };
|
|
@@ -24,7 +24,7 @@ const hexTable = (function() {
|
|
|
24
24
|
return array;
|
|
25
25
|
})();
|
|
26
26
|
const limit = 1024;
|
|
27
|
-
const encode = function encode2(str,
|
|
27
|
+
const encode = function encode2(str, _defaultEncoder, _kind, format) {
|
|
28
28
|
if (str.length === 0) {
|
|
29
29
|
return str;
|
|
30
30
|
}
|
|
@@ -34,11 +34,6 @@ const encode = function encode2(str, defaultEncoder, charset, kind, format) {
|
|
|
34
34
|
} else if (typeof str !== "string") {
|
|
35
35
|
string = String(str);
|
|
36
36
|
}
|
|
37
|
-
if (charset === "iso-8859-1") {
|
|
38
|
-
return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) {
|
|
39
|
-
return "%26%23" + parseInt($0.slice(2), 16) + "%3B";
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
37
|
let out = "";
|
|
43
38
|
for (let j = 0; j < string.length; j += limit) {
|
|
44
39
|
const segment = string.length >= limit ? string.slice(j, j + limit) : string;
|
|
@@ -117,8 +112,6 @@ const defaults = {
|
|
|
117
112
|
allowDots: false,
|
|
118
113
|
allowEmptyArrays: false,
|
|
119
114
|
arrayFormat: "indices",
|
|
120
|
-
charset: "utf-8",
|
|
121
|
-
charsetSentinel: false,
|
|
122
115
|
delimiter: "&",
|
|
123
116
|
encode: true,
|
|
124
117
|
encodeDotInKeys: false,
|
|
@@ -138,7 +131,7 @@ const isNonNullishPrimitive = function isNonNullishPrimitive2(v) {
|
|
|
138
131
|
return typeof v === "string" || typeof v === "number" || typeof v === "boolean" || typeof v === "symbol" || typeof v === "bigint";
|
|
139
132
|
};
|
|
140
133
|
const sentinel = {};
|
|
141
|
-
const _stringify = function stringify2(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate2, format, formatter, encodeValuesOnly,
|
|
134
|
+
const _stringify = function stringify2(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter, sort, allowDots, serializeDate2, format, formatter, encodeValuesOnly, sideChannel) {
|
|
142
135
|
let obj = object;
|
|
143
136
|
let tmpSc = sideChannel;
|
|
144
137
|
let step = 0;
|
|
@@ -171,15 +164,15 @@ const _stringify = function stringify2(object, prefix, generateArrayPrefix, comm
|
|
|
171
164
|
}
|
|
172
165
|
if (obj === null) {
|
|
173
166
|
if (strictNullHandling) {
|
|
174
|
-
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder,
|
|
167
|
+
return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, "key", format) : prefix;
|
|
175
168
|
}
|
|
176
169
|
obj = "";
|
|
177
170
|
}
|
|
178
171
|
if (isNonNullishPrimitive(obj) || isBuffer(obj)) {
|
|
179
172
|
if (encoder) {
|
|
180
|
-
const keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder,
|
|
173
|
+
const keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, "key", format);
|
|
181
174
|
return [
|
|
182
|
-
formatter(keyValue) + "=" + formatter(encoder(obj, defaults.encoder,
|
|
175
|
+
formatter(keyValue) + "=" + formatter(encoder(obj, defaults.encoder, "value", format))
|
|
183
176
|
];
|
|
184
177
|
}
|
|
185
178
|
return [formatter(prefix) + "=" + formatter(String(obj))];
|
|
@@ -235,7 +228,6 @@ const _stringify = function stringify2(object, prefix, generateArrayPrefix, comm
|
|
|
235
228
|
format,
|
|
236
229
|
formatter,
|
|
237
230
|
encodeValuesOnly,
|
|
238
|
-
charset,
|
|
239
231
|
valueSideChannel
|
|
240
232
|
)
|
|
241
233
|
);
|
|
@@ -296,20 +288,12 @@ function stringify(object, opts) {
|
|
|
296
288
|
options.format,
|
|
297
289
|
options.formatter,
|
|
298
290
|
options.encodeValuesOnly,
|
|
299
|
-
options.charset,
|
|
300
291
|
sideChannel
|
|
301
292
|
)
|
|
302
293
|
);
|
|
303
294
|
}
|
|
304
295
|
const joined = keys.join(options.delimiter);
|
|
305
|
-
|
|
306
|
-
if (options.charsetSentinel) {
|
|
307
|
-
if (options.charset === "iso-8859-1") {
|
|
308
|
-
prefix += "utf8=%26%2310003%3B&";
|
|
309
|
-
} else {
|
|
310
|
-
prefix += "utf8=%E2%9C%93&";
|
|
311
|
-
}
|
|
312
|
-
}
|
|
296
|
+
const prefix = options.addQueryPrefix === true ? "?" : "";
|
|
313
297
|
return joined.length > 0 ? prefix + joined : "";
|
|
314
298
|
}
|
|
315
299
|
|
|
@@ -319,10 +303,13 @@ class Paginator extends Array {
|
|
|
319
303
|
this.totalNumber = totalNumber;
|
|
320
304
|
this.perPage = perPage;
|
|
321
305
|
this.currentPage = currentPage;
|
|
322
|
-
this.totalNumber =
|
|
306
|
+
this.totalNumber = totalNumber;
|
|
323
307
|
this.rows = rows;
|
|
324
308
|
this.isEmpty = this.rows.length === 0;
|
|
325
309
|
}
|
|
310
|
+
totalNumber;
|
|
311
|
+
perPage;
|
|
312
|
+
currentPage;
|
|
326
313
|
/**
|
|
327
314
|
* The first page is always 1
|
|
328
315
|
*/
|
|
@@ -448,7 +435,7 @@ class Paginator extends Array {
|
|
|
448
435
|
* to cast it to a bigint.
|
|
449
436
|
*/
|
|
450
437
|
get total() {
|
|
451
|
-
return
|
|
438
|
+
return this.totalNumber;
|
|
452
439
|
}
|
|
453
440
|
}
|
|
454
441
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/pagination",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.9",
|
|
4
4
|
"description": "Simple Pagination for Node.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"page",
|
|
13
13
|
"paging"
|
|
14
14
|
],
|
|
15
|
-
"homepage": "https://
|
|
15
|
+
"homepage": "https://visulima.com/packages/pagination/",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/visulima/visulima/issues"
|
|
18
18
|
},
|
|
@@ -51,9 +51,6 @@
|
|
|
51
51
|
"CHANGELOG.md",
|
|
52
52
|
"LICENSE.md"
|
|
53
53
|
],
|
|
54
|
-
"dependencies": {},
|
|
55
|
-
"peerDependencies": {},
|
|
56
|
-
"optionalDependencies": {},
|
|
57
54
|
"engines": {
|
|
58
55
|
"node": ">=22.13 <=25.x"
|
|
59
56
|
},
|