datatypes-validation
Version:
     
35 lines • 1.19 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const Rules_1 = require("../Rules");
const isRequired_1 = require("../SingleRulesFunctions/isRequired");
const arrayOf_1 = require("../SingleRulesFunctions/arrayOf");
const minLength_1 = require("../SingleRulesFunctions/minLength");
const maxLength_1 = require("../SingleRulesFunctions/maxLength");
const __1 = require("../../../..");
class ArrayOfRules extends Rules_1.Rules {
arrayOf(arrayOfArg) {
this.rules.arrayOf = arrayOf_1.arrayOf(arrayOfArg);
return this;
}
isRequired(options = {}) {
this.rules.required = isRequired_1.isRequired(options);
return this;
}
get required() {
return this.isRequired();
}
minLength(min, options = {}) {
this.rules.minLength = minLength_1.minLength(min, options);
return this;
}
maxLength(max, options = {}) {
this.rules.maxLength = maxLength_1.maxLength(max, options);
return this;
}
custom(callback) {
this.rules.custom = __1.custom(callback);
return this;
}
}
exports.ArrayOfRules = ArrayOfRules;
//# sourceMappingURL=ArrayOfRules.js.map