ConstraintMetadata.js 1.0 KB

12345678910111213141516171819202122232425262728
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.ConstraintMetadata = void 0;
  4. const container_1 = require("../container");
  5. /**
  6. * This metadata interface contains information for custom validators.
  7. */
  8. class ConstraintMetadata {
  9. // -------------------------------------------------------------------------
  10. // Constructor
  11. // -------------------------------------------------------------------------
  12. constructor(target, name, async = false) {
  13. this.target = target;
  14. this.name = name;
  15. this.async = async;
  16. }
  17. // -------------------------------------------------------------------------
  18. // Accessors
  19. // -------------------------------------------------------------------------
  20. /**
  21. * Instance of the target custom validation class which performs validation.
  22. */
  23. get instance() {
  24. return (0, container_1.getFromContainer)(this.target);
  25. }
  26. }
  27. exports.ConstraintMetadata = ConstraintMetadata;
  28. //# sourceMappingURL=ConstraintMetadata.js.map