UNPKG

1.05 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.ConstraintMetadata = void 0;
4const container_1 = require("../container");
5/**
6 * This metadata interface contains information for custom validators.
7 */
8class 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}
27exports.ConstraintMetadata = ConstraintMetadata;
28//# sourceMappingURL=ConstraintMetadata.js.map
\No newline at end of file