@x-spacy/pagination 1.0.13 → 1.0.15
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.
|
@@ -17,8 +17,8 @@ const PaginationLinkTypeEnum_1 = require("../enums/PaginationLinkTypeEnum");
|
|
|
17
17
|
let PaginateInterceptor = class PaginateInterceptor {
|
|
18
18
|
intercept(context, next) {
|
|
19
19
|
const request = context.switchToHttp().getRequest();
|
|
20
|
-
const page = Math.max(1, parseInt(request.query.page, 10)
|
|
21
|
-
const perPage = Math.min(100, Math.max(1, parseInt(request.query.perPage, 10)
|
|
20
|
+
const page = Math.max(1, parseInt(request.query.page, 10) || 1);
|
|
21
|
+
const perPage = Math.min(100, Math.max(1, parseInt(request.query.perPage, 10) || 10));
|
|
22
22
|
const path = `${request.protocol}://${request.get('host') + request.path}`;
|
|
23
23
|
return next.handle().pipe((0, operators_1.map)((data) => {
|
|
24
24
|
if (!(data instanceof Page_1.Page)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x-spacy/pagination",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "A pagination library for NestJS",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@nestjs/common": "^11.1.13",
|
|
31
31
|
"@nestjs/core": "^11.1.13",
|
|
32
|
-
"@x-spacy/eslint-config": "^1.35.0",
|
|
33
32
|
"class-transformer": "^0.5.1",
|
|
34
33
|
"express": "^5.2.1",
|
|
35
34
|
"reflect-metadata": "^0.2.2",
|
|
@@ -37,6 +36,7 @@
|
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
38
|
"@nestjs/cli": "^11.0.16",
|
|
39
|
+
"@x-spacy/eslint-config": "^1.35.0",
|
|
40
40
|
"@types/express": "^5.0.6",
|
|
41
41
|
"typescript": "^5.9.3"
|
|
42
42
|
}
|