summaryrefslogtreecommitdiff
path: root/src/node_modules/class-validator/esm2015/metadata/ConstraintMetadata.js
blob: 335537282f73640351c9d24eccb6266e479ff1ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { getFromContainer } from "../container";
/**
 * This metadata interface contains information for custom validators.
 */
export class ConstraintMetadata {
    // -------------------------------------------------------------------------
    // Constructor
    // -------------------------------------------------------------------------
    constructor(target, name, async = false) {
        this.target = target;
        this.name = name;
        this.async = async;
    }
    // -------------------------------------------------------------------------
    // Accessors
    // -------------------------------------------------------------------------
    /**
     * Instance of the target custom validation class which performs validation.
     */
    get instance() {
        return getFromContainer(this.target);
    }
}

//# sourceMappingURL=ConstraintMetadata.js.map