@bpframework/validation
Version:
Some typescript decorators, like spring-validation and so on
34 lines • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Null = void 0;
const validatorUtils_1 = require("./validatorUtils");
function verify(propertyValue, decoratorData) {
if (propertyValue !== undefined && propertyValue !== null) {
return { isValid: false };
}
return { propertyValue: propertyValue };
}
function verify_list(propertyValue, decoratorData) {
return validatorUtils_1.verifyPropertyList(propertyValue, decoratorData, verify);
}
function DecoratorList(...args) {
if (args.length == 1 || args.length == 0) {
let cfg = args[0] || {};
return validatorUtils_1.getPropertyDecorator(verify_list, cfg);
}
else {
validatorUtils_1.doPropertyDecorator(args[0], args[1], verify_list, {});
}
}
Null.List = DecoratorList;
function Null(...args) {
if (args.length == 1 || args.length == 0) {
let cfg = args[0] || {};
return validatorUtils_1.getPropertyDecorator(verify, cfg);
}
else {
validatorUtils_1.doPropertyDecorator(args[0], args[1], verify, {});
}
}
exports.Null = Null;
//# sourceMappingURL=Null.js.map