lib/components/validation/annotations/constraints.js
function addAnnotation(target, key, index, data) {
    const classAnnotationsStore = container.get(AnnotationsServiceName.ClassAnnotationsStore);
    if (index === undefined) {
        // property
        classAnnotationsStore.addPropertyAnnotation(target.constructor, key, Constraints, data);
    }
    else {
        // method parameter
        classAnnotationsStore.addMethodParameterAnnotation(target.constructor, key, index, Constraints, data);
    }
}
function addAnnotation(target, key, index, data) {
    const classAnnotationsStore = container.get(AnnotationsServiceName.ClassAnnotationsStore);
    if (index === undefined) {
        // property
        classAnnotationsStore.addPropertyAnnotation(target.constructor, key, Constraints, data);
    }
    else {
        // method parameter
        classAnnotationsStore.addMethodParameterAnnotation(target.constructor, key, index, Constraints, data);
    }
}
function addAnnotation ( target , key , index , data ) { const classAnnotationsStore = container . get ( AnnotationsServiceName . ClassAnnotationsStore ) ; if ( index === undefined ) { // property classAnnotationsStore . addPropertyAnnotation ( target . constructor , key , Constraints , data ) ; } else { // method parameter classAnnotationsStore . addMethodParameterAnnotation ( target . constructor , key , index , Constraints , data ) ; } }
Annotation to property or method
Annotation to property or method