java-bean-validation.js
Version:
Java Bean Validation implementation for JavaScript
29 lines • 1.23 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("../core/core");
function lookupTypeDescriptor(typeOrTypeName, value, path, globalViolations) {
if (typeOrTypeName.typeName) {
return typeOrTypeName;
}
else {
return core_1.getTypeDescriptor(typeOrTypeName, value, path, globalViolations);
}
}
exports.lookupTypeDescriptor = lookupTypeDescriptor;
function lookupPropertyDescriptor(propertyOrTypeOrTypeName, propertyName, objectWithProperty, path, globalViolations) {
if (propertyOrTypeOrTypeName.porpertyTypeName) {
return propertyOrTypeOrTypeName;
}
else if (propertyOrTypeOrTypeName.typeName) {
return core_1.getPropertyDescriptor(propertyOrTypeOrTypeName, objectWithProperty, propertyName, path, globalViolations);
}
else {
var type = core_1.getTypeDescriptor(propertyOrTypeOrTypeName, objectWithProperty, path, globalViolations);
if (!type) {
return null;
}
return core_1.getPropertyDescriptor(type, objectWithProperty, propertyName, path, globalViolations);
}
}
exports.lookupPropertyDescriptor = lookupPropertyDescriptor;
//# sourceMappingURL=lookup.js.map