@simpli/resource-collection
Advanced tools
Comparing version 1.0.7 to 1.0.8
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=ClassType.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=Dictionary.js.map |
@@ -0,0 +0,0 @@ "use strict"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=IResource.js.map |
@@ -118,10 +118,9 @@ "use strict"; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!(!this.search || !this.search.length || this.search.length >= PageCollection_1.defaultMinCharToSearch)) return [3 /*break*/, 2]; | ||
this.currentPage = 0; | ||
return [4 /*yield*/, this.queryAsPage()]; | ||
case 1: return [2 /*return*/, _a.sent()]; | ||
case 2: return [2 /*return*/, Promise.resolve()]; | ||
if (!this.search || | ||
!this.search.length || | ||
this.search.length >= PageCollection_1.defaultMinCharToSearch) { | ||
this.currentPage = 0; | ||
return [2 /*return*/, this.queryAsPage()]; | ||
} | ||
return [2 /*return*/, Promise.resolve()]; | ||
}); | ||
@@ -133,14 +132,10 @@ }); | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (this.orderBy === column) { | ||
this.asc = !this.asc; | ||
} | ||
else { | ||
this.asc = true; | ||
} | ||
this.orderBy = column; | ||
return [4 /*yield*/, this.queryAsPage()]; | ||
case 1: return [2 /*return*/, _a.sent()]; | ||
if (this.orderBy === column) { | ||
this.asc = !this.asc; | ||
} | ||
else { | ||
this.asc = true; | ||
} | ||
this.orderBy = column; | ||
return [2 /*return*/, this.queryAsPage()]; | ||
}); | ||
@@ -152,15 +147,11 @@ }); | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (val > this.lastPage) { | ||
this.currentPage = this.lastPage; | ||
} | ||
else if (val < 0) { | ||
this.currentPage = 0; | ||
} | ||
else | ||
this.currentPage = val; | ||
return [4 /*yield*/, this.queryAsPage()]; | ||
case 1: return [2 /*return*/, _a.sent()]; | ||
if (val > this.lastPage) { | ||
this.currentPage = this.lastPage; | ||
} | ||
else if (val < 0) { | ||
this.currentPage = 0; | ||
} | ||
else | ||
this.currentPage = val; | ||
return [2 /*return*/, this.queryAsPage()]; | ||
}); | ||
@@ -172,10 +163,7 @@ }); | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!(this.currentPage !== null && this.currentPage > 0)) return [3 /*break*/, 2]; | ||
this.currentPage--; | ||
return [4 /*yield*/, this.queryAsPage()]; | ||
case 1: return [2 /*return*/, _a.sent()]; | ||
case 2: return [2 /*return*/, Promise.resolve()]; | ||
if (this.currentPage !== null && this.currentPage > 0) { | ||
this.currentPage--; | ||
return [2 /*return*/, this.queryAsPage()]; | ||
} | ||
return [2 /*return*/, Promise.resolve()]; | ||
}); | ||
@@ -187,10 +175,7 @@ }); | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!(this.currentPage !== null && this.currentPage < this.lastPage)) return [3 /*break*/, 2]; | ||
this.currentPage++; | ||
return [4 /*yield*/, this.queryAsPage()]; | ||
case 1: return [2 /*return*/, _a.sent()]; | ||
case 2: return [2 /*return*/, Promise.resolve()]; | ||
if (this.currentPage !== null && this.currentPage < this.lastPage) { | ||
this.currentPage++; | ||
return [2 /*return*/, this.queryAsPage()]; | ||
} | ||
return [2 /*return*/, Promise.resolve()]; | ||
}); | ||
@@ -203,2 +188,11 @@ }); | ||
PageCollection.defaultPerPage = 20; | ||
PageCollection.defaultBeforeQueryAction = function () { | ||
/**/ | ||
}; | ||
PageCollection.defaultAfterQueryAction = function () { | ||
/**/ | ||
}; | ||
PageCollection.defaultErrorQueryAction = function () { | ||
/**/ | ||
}; | ||
__decorate([ | ||
@@ -205,0 +199,0 @@ class_transformer_1.Expose({ name: 'query', toPlainOnly: true }), |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
//# sourceMappingURL=QueryFilter.js.map |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -9,2 +9,5 @@ import { ResourceCollection } from './ResourceCollection'; | ||
static defaultPerPage: number; | ||
static defaultBeforeQueryAction: () => void; | ||
static defaultAfterQueryAction: () => void; | ||
static defaultErrorQueryAction: () => void; | ||
search: string | null; | ||
@@ -11,0 +14,0 @@ currentPage: number | null; |
{ | ||
"name": "@simpli/resource-collection", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "A data-structure library to work with ResourceCollections (with Id and Tag) and PageCollections (search and order as well)", | ||
@@ -15,3 +15,3 @@ "keywords": [], | ||
"type": "git", | ||
"url": "" | ||
"url": "https://github.com/simplitech/resource-collection" | ||
}, | ||
@@ -36,3 +36,5 @@ "license": "MIT", | ||
"precommit": "lint-staged", | ||
"travis-deploy-once": "travis-deploy-once" | ||
"travis-deploy-once": "travis-deploy-once", | ||
"prepush": "npm run test:prod && npm run build", | ||
"commitmsg": "commitlint -E HUSKY_GIT_PARAMS" | ||
}, | ||
@@ -113,3 +115,3 @@ "lint-staged": { | ||
"rollup-plugin-typescript2": "^0.25.3", | ||
"semantic-release": "^15.9.16", | ||
"semantic-release": "^17.0.4", | ||
"shelljs": "^0.8.3", | ||
@@ -116,0 +118,0 @@ "travis-deploy-once": "^5.0.9", |
@@ -0,0 +0,0 @@ # Resource-Collection |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
0
2705092
21035
11