UNPKG

class-validator

Version:

Class-based validation with Typescript / ES6 / ES5 using decorators or validation schemas. Supports both node.js and browser

34 lines (32 loc) 1.2 kB
"use strict"; var index_1 = require("../index"); /** * This metadata interface contains information for custom validators. */ var ConstraintMetadata = (function () { // ------------------------------------------------------------------------- // Constructor // ------------------------------------------------------------------------- function ConstraintMetadata(target, name, async) { if (async === void 0) { async = false; } this.target = target; this.name = name; this.async = async; } Object.defineProperty(ConstraintMetadata.prototype, "instance", { // ------------------------------------------------------------------------- // Accessors // ------------------------------------------------------------------------- /** * Instance of the target custom validation class which performs validation. */ get: function () { return index_1.getFromContainer(this.target); }, enumerable: true, configurable: true }); return ConstraintMetadata; }()); exports.ConstraintMetadata = ConstraintMetadata; //# sourceMappingURL=ConstraintMetadata.js.map