jinaga
Version:
Data management for web and mobile applications.
31 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PurgeConditions = void 0;
const description_1 = require("../specification/description");
class PurgeConditions {
constructor(specifications) {
this.specifications = specifications;
}
whenExists(specification) {
return new PurgeConditions([
...this.specifications,
specification.specification
]);
}
with(fn) {
return fn(this);
}
merge(purgeConditions) {
return new PurgeConditions([
...this.specifications,
...purgeConditions.specifications
]);
}
saveToDescription() {
const specificationDescriptions = this.specifications.map(s => (0, description_1.describeSpecification)(s, 1)).join("");
return `purge {\n${specificationDescriptions}}\n`;
}
}
exports.PurgeConditions = PurgeConditions;
PurgeConditions.empty = new PurgeConditions([]);
//# sourceMappingURL=purgeConditions.js.map