@commodo/fields-storage
Version:
We're working hard to get all the docs in order. New articles will be added daily.
52 lines (41 loc) • 842 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
class Collection extends Array {
constructor(values = []) {
super();
this.__model = {
params: {},
meta: {}
};
if (Array.isArray(values)) {
values.map(item => this.push(item));
}
}
setParams(params) {
this.__model.params = params;
return this;
}
getParams() {
return this.__model.params;
}
setMeta(meta) {
this.__model.meta = meta;
return this;
}
getMeta() {
return this.__model.meta;
}
setTotalCount(totalCount) {
this.__model.meta.totalCount = totalCount;
return this;
}
getTotalCount() {
return this.__model.meta.totalCount;
}
}
var _default = Collection;
exports.default = _default;
//# sourceMappingURL=Collection.js.map