chain-condition.js 479 B

12345678910111213141516
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.ChainCondition = void 0;
  4. const base_1 = require("../base");
  5. class ChainCondition {
  6. constructor(chain) {
  7. this.chain = chain;
  8. }
  9. async run(_context, _value, meta) {
  10. const result = await this.chain.run(meta.req, { dryRun: true });
  11. if (!result.isEmpty()) {
  12. throw new base_1.ValidationHalt();
  13. }
  14. }
  15. }
  16. exports.ChainCondition = ChainCondition;