New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@simpli/resource-collection

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@simpli/resource-collection - npm Package Compare versions

Comparing version 1.1.6 to 1.1.7

3

dist/lib/ClassType.js

@@ -1,3 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
//# sourceMappingURL=ClassType.js.map

@@ -1,3 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
//# sourceMappingURL=Dictionary.js.map

@@ -1,2 +0,1 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -6,6 +5,8 @@ var extendStatics = function (d, b) {

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -26,6 +27,7 @@ function __() { this.constructor = d; }

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -40,3 +42,3 @@ });

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -62,5 +64,13 @@ if (y = 0, t) op = [op[0] & 2, t.value];

};
Object.defineProperty(exports, "__esModule", { value: true });
var class_transformer_1 = require("class-transformer");
var PageCollection_1 = require("./PageCollection");
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
import { instanceToInstance, Exclude, Expose, Type } from 'class-transformer';
import { PageCollection } from './PageCollection';
var ExpansibleCollection = /** @class */ (function (_super) {

@@ -82,6 +92,7 @@ __extends(ExpansibleCollection, _super);

},
enumerable: true,
enumerable: false,
configurable: true
});
Object.defineProperty(ExpansibleCollection.prototype, "currentPage", {
// @ts-ignore
get: function () {

@@ -93,3 +104,3 @@ return this._currentPage || 0;

},
enumerable: true,
enumerable: false,
configurable: true

@@ -102,3 +113,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -136,3 +147,3 @@ });

// 5 - populate items with cloned list
this.items = this.expandedItems.slice();
this.items = __spreadArray([], this.expandedItems, true);
this.isExpanding = false;

@@ -157,4 +168,4 @@ return [2 /*return*/];

_a.sent();
this.expandedItems = this.addedItems.slice();
this.items = class_transformer_1.classToClass(this.expandedItems);
this.expandedItems = __spreadArray([], this.addedItems, true);
this.items = instanceToInstance(this.expandedItems);
this.perPage = perPage;

@@ -203,12 +214,12 @@ this.currentPage = currentPage;

__decorate([
class_transformer_1.Type(function (options) { return options.newObject.classType; }),
class_transformer_1.Expose({ name: 'items', toClassOnly: true }),
Type(function (options) { return options.newObject.classType; }),
Expose({ name: 'items', toClassOnly: true }),
__metadata("design:type", Array)
], ExpansibleCollection.prototype, "addedItems", void 0);
ExpansibleCollection = __decorate([
class_transformer_1.Exclude()
Exclude()
], ExpansibleCollection);
return ExpansibleCollection;
}(PageCollection_1.PageCollection));
exports.ExpansibleCollection = ExpansibleCollection;
}(PageCollection));
export { ExpansibleCollection };
//# sourceMappingURL=ExpansibleCollection.js.map

@@ -1,10 +0,9 @@

"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
require("core-js");
__export(require("./ResourceCollection"));
__export(require("./PageCollection"));
__export(require("./ExpansibleCollection"));
import 'core-js';
export * from './ResourceCollection';
export * from './PageCollection';
export * from './ExpansibleCollection';
export * from './IResource';
export * from './ClassType';
export * from './Dictionary';
export * from './QueryFilter';
//# sourceMappingURL=index.js.map

@@ -1,3 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
//# sourceMappingURL=IResource.js.map

@@ -1,2 +0,1 @@

"use strict";
var __extends = (this && this.__extends) || (function () {

@@ -6,6 +5,8 @@ var extendStatics = function (d, b) {

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);

@@ -26,6 +27,7 @@ function __() { this.constructor = d; }

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -40,3 +42,3 @@ });

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -62,5 +64,4 @@ if (y = 0, t) op = [op[0] & 2, t.value];

};
Object.defineProperty(exports, "__esModule", { value: true });
var class_transformer_1 = require("class-transformer");
var ResourceCollection_1 = require("./ResourceCollection");
import { Exclude, Expose, Type } from 'class-transformer';
import { ResourceCollection } from './ResourceCollection';
var PageCollection = /** @class */ (function (_super) {

@@ -86,3 +87,3 @@ __extends(PageCollection, _super);

},
enumerable: true,
enumerable: false,
configurable: true

@@ -94,3 +95,3 @@ });

},
enumerable: true,
enumerable: false,
configurable: true

@@ -190,37 +191,37 @@ });

__decorate([
class_transformer_1.Expose({ name: 'query', toPlainOnly: true }),
Expose({ name: 'query', toPlainOnly: true }),
__metadata("design:type", Object)
], PageCollection.prototype, "search", void 0);
__decorate([
class_transformer_1.Expose({ name: 'page', toPlainOnly: true }),
Expose({ name: 'page', toPlainOnly: true }),
__metadata("design:type", Number)
], PageCollection.prototype, "currentPage", void 0);
__decorate([
class_transformer_1.Expose({ name: 'limit', toPlainOnly: true }),
Expose({ name: 'limit', toPlainOnly: true }),
__metadata("design:type", Object)
], PageCollection.prototype, "perPage", void 0);
__decorate([
class_transformer_1.Expose({ name: 'orderBy', toPlainOnly: true }),
Expose({ name: 'orderBy', toPlainOnly: true }),
__metadata("design:type", Object)
], PageCollection.prototype, "orderBy", void 0);
__decorate([
class_transformer_1.Expose({ name: 'ascending', toPlainOnly: true }),
Expose({ name: 'ascending', toPlainOnly: true }),
__metadata("design:type", Object)
], PageCollection.prototype, "asc", void 0);
__decorate([
class_transformer_1.Type(function (options) { return options.newObject.classType; }),
class_transformer_1.Expose({ name: 'items', toClassOnly: true }),
Type(function (options) { return options.newObject.classType; }),
Expose({ name: 'items', toClassOnly: true }),
__metadata("design:type", Array)
], PageCollection.prototype, "items", void 0);
__decorate([
class_transformer_1.Expose({ name: 'total', toClassOnly: true }),
Expose({ name: 'total', toClassOnly: true }),
__metadata("design:type", Object)
], PageCollection.prototype, "total", void 0);
PageCollection = PageCollection_1 = __decorate([
class_transformer_1.Exclude(),
Exclude(),
__metadata("design:paramtypes", [Object])
], PageCollection);
return PageCollection;
}(ResourceCollection_1.ResourceCollection));
exports.PageCollection = PageCollection;
}(ResourceCollection));
export { PageCollection };
//# sourceMappingURL=PageCollection.js.map

@@ -1,3 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
export {};
//# sourceMappingURL=QueryFilter.js.map

@@ -1,4 +0,2 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var class_transformer_1 = require("class-transformer");
import { instanceToInstance, instanceToPlain } from 'class-transformer';
var ResourceCollection = /** @class */ (function () {

@@ -17,3 +15,3 @@ function ResourceCollection(classType, items) {

var params = {};
var plainFilter = class_transformer_1.classToPlain(filter);
var plainFilter = instanceToPlain(filter);
Object.keys(plainFilter).forEach(function (key) {

@@ -32,3 +30,3 @@ if (plainFilter[key] !== null) {

},
enumerable: true,
enumerable: false,
configurable: true

@@ -95,3 +93,3 @@ });

ResourceCollection.prototype.clone = function (fromEntity, options) {
return class_transformer_1.classToClass(fromEntity, options);
return instanceToInstance(fromEntity, options);
};

@@ -103,3 +101,3 @@ ResourceCollection.prototype.onBeforeSerialization = function () {

}());
exports.ResourceCollection = ResourceCollection;
export { ResourceCollection };
//# sourceMappingURL=ResourceCollection.js.map

@@ -10,5 +10,6 @@ import { IResource } from './IResource';

protected isExpanding: boolean;
readonly isLastPage: boolean;
currentPage: number;
readonly maxPerPage: number;
get isLastPage(): boolean;
get currentPage(): number;
set currentPage(val: number);
get maxPerPage(): number;
expand(): Promise<void>;

@@ -15,0 +16,0 @@ update(): Promise<void>;

@@ -16,4 +16,4 @@ import { ResourceCollection } from './ResourceCollection';

total: number | null;
readonly isLastPage: boolean;
readonly lastPage: number;
get isLastPage(): boolean;
get lastPage(): number;
noPagination(): this;

@@ -20,0 +20,0 @@ setSearch(val: string | null): this;

import { Dictionary } from './Dictionary';
export declare type QueryFilter = Dictionary<any>;
export type QueryFilter = Dictionary<any>;

@@ -11,3 +11,3 @@ import { IResource } from './IResource';

readonly instance: R;
readonly params: Dictionary<any>;
get params(): Dictionary<any>;
first(): R;

@@ -14,0 +14,0 @@ last(): R;

{
"name": "@simpli/resource-collection",
"version": "1.1.6",
"version": "1.1.7",
"description": "A data-structure library to work with ResourceCollections (with Id and Tag) and PageCollections (search and order as well)",

@@ -24,3 +24,3 @@ "keywords": [],

"prebuild": "rimraf dist",
"build": "tsc --module commonjs && rollup -c rollup.config.ts && typedoc --out docs --target es6 --theme minimal --mode file src",
"build": "tsc --module es6 && rollup -c rollup.config.ts --bundleConfigAsCjs --target es6",
"start": "rollup -c rollup.config.ts -w",

@@ -33,6 +33,6 @@ "test": "jest --coverage",

"commit": "git-cz",
"semantic-release": "semantic-release",
">=20.0.4": "semantic-release",
"semantic-release-prepare": "ts-node tools/semantic-release-prepare",
"precommit": "lint-staged",
"travis-deploy-once": "travis-deploy-once",
">=5.0.11": "travis-deploy-once",
"prepush": "npm run test:prod && npm run build",

@@ -89,38 +89,35 @@ "commitmsg": "commitlint -E HUSKY_GIT_PARAMS"

"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^7.1.2",
"@types/jest": "^23.3.2",
"@types/node": "^10.11.0",
"class-transformer": "^0.4.0",
"colors": "^1.3.2",
"commitizen": "^3.0.0",
"core-js": "^3.6.4",
"coveralls": "^3.0.2",
"cross-env": "^5.2.0",
"cz-conventional-changelog": "^2.1.0",
"husky": "^1.0.1",
"jest": "^25.1.0",
"jest-config": "^25.1.0",
"lint-staged": "^8.0.0",
"@rollup/plugin-commonjs": "^24.0.1",
"@rollup/plugin-typescript": "^11.0.0",
"@types/jest": "^29.2.6",
"@types/node": "^18.11.18",
"axios": "^1.2.4",
"class-transformer": "^0.5.1",
"colors": "^1.4.0",
"commitizen": "^4.3.0",
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
"cz-conventional-changelog": "^3.3.0",
"husky": "^8.0.3",
"jest": "^29.4.0",
"jest-config": "^29.4.0",
"lint-staged": "^13.1.0",
"lodash.camelcase": "^4.3.0",
"prettier": "^1.14.3",
"prompt": "^1.0.0",
"replace-in-file": "^3.4.2",
"rimraf": "^2.6.2",
"rollup": "^0.67.0",
"rollup-plugin-commonjs": "^9.1.8",
"rollup-plugin-json": "^3.1.0",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-typescript2": "^0.25.3",
"semantic-release": "^17.0.4",
"shelljs": "^0.8.3",
"travis-deploy-once": "^5.0.9",
"ts-jest": "^23.10.2",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0",
"tslint-config-standard": "^8.0.1",
"typedoc": "^0.16.7",
"typescript": "3.4.4"
"prompt": "^1.3.0",
"replace-in-file": "^6.3.5",
"rimraf": "^4.1.2",
"rollup-plugin-typescript2": "^0.34.1",
"semantic-release": "^20.0.4",
"shelljs": "^0.8.5",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"tslib": "^2.4.1",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0",
"tslint-config-standard": "^9.0.0",
"typedoc": "^0.23.24",
"typescript": "^4.9.4"
},

@@ -133,3 +130,9 @@ "peerDependencies": {

"test": "test"
},
"dependencies": {
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-sourcemaps": "^0.6.3"
}
}

@@ -0,0 +0,0 @@ # Resource-Collection

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc