epic-validator
Version:
A simple but powerful Data Validator
14 lines (13 loc) • 557 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Validation = void 0;
const chain_1 = require("./chain");
class Validation {
constructor(CustomValidators) {
this.CustomValidators = CustomValidators;
this.validate = (target, identifier) => new chain_1.ValidationChain(this.CustomValidators, target, identifier);
if (typeof this.CustomValidators !== "object")
throw new Error("Please provide a valid Custom Validators object!");
}
}
exports.Validation = Validation;