lib/schemaobject.js
function detectCustomErrorMessage(key) {
            if (typeof properties[key] === 'object' && properties[key].errorMessage && properties[key].value) {
                return properties[key];
            }
            else  if (_.isArray(properties[key])) {
                return {
                    value: properties[key][0],
                    errorMessage: properties[key][1]
                };
            }
            else {
                return {
                    value: properties[key],
                    errorMessage: undefined
                };
            }
        }
function detectCustomErrorMessage(key) {
            if (typeof properties[key] === 'object' && properties[key].errorMessage && properties[key].value) {
                return properties[key];
            }
            else  if (_.isArray(properties[key])) {
                return {
                    value: properties[key][0],
                    errorMessage: properties[key][1]
                };
            }
            else {
                return {
                    value: properties[key],
                    errorMessage: undefined
                };
            }
        }
function detectCustomErrorMessage ( key ) { if ( typeof properties [ key ] === 'object' && properties [ key ] . errorMessage && properties [ key ] . value ) { return properties [ key ] ; } else if ( _ . isArray ( properties [ key ] ) ) { return { value : properties [ key ] [ 0 ] , errorMessage : properties [ key ] [ 1 ] } ; } else { return { value : properties [ key ] , errorMessage : undefined } ; } }
Helper function designed to detect and handle usage of array-form custom error messages for validators
Helper function designed to detect and handle usage of array - form custom error messages for validators