UNPKG

1.19 kBJavaScriptView Raw
1import { getFromContainer } from '../container';
2/**
3 * This metadata interface contains information for custom validators.
4 */
5var ConstraintMetadata = /** @class */ (function () {
6 // -------------------------------------------------------------------------
7 // Constructor
8 // -------------------------------------------------------------------------
9 function ConstraintMetadata(target, name, async) {
10 if (async === void 0) { async = false; }
11 this.target = target;
12 this.name = name;
13 this.async = async;
14 }
15 Object.defineProperty(ConstraintMetadata.prototype, "instance", {
16 // -------------------------------------------------------------------------
17 // Accessors
18 // -------------------------------------------------------------------------
19 /**
20 * Instance of the target custom validation class which performs validation.
21 */
22 get: function () {
23 return getFromContainer(this.target);
24 },
25 enumerable: false,
26 configurable: true
27 });
28 return ConstraintMetadata;
29}());
30export { ConstraintMetadata };
31//# sourceMappingURL=ConstraintMetadata.js.map
\No newline at end of file