xsolla
Version:
A Node.js client for working with the Xsolla Merchant API
24 lines (23 loc) • 546 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Collection {
/**
* Collection constructor.
*/
constructor(client) {
this.client = client;
}
/**
* Create model instance using the given data.
*/
createModel(data) {
return new this.model(data, this.client);
}
/**
* Create list of models.
*/
createModelList(data) {
return data.map((data) => this.createModel(data));
}
}
exports.default = Collection;