static/ext/src/data/validations.js
function(config, value) {
        if (value === undefined || value === null) {
            return false;
        }
        
        var length = value.length,
            min    = config.min,
            max    = config.max;
        
        if ((min && length < min) || (max && length > max)) {
            return false;
        } else {
            return true;
        }
    }
function(config, value) {
        if (value === undefined || value === null) {
            return false;
        }
        
        var length = value.length,
            min    = config.min,
            max    = config.max;
        
        if ((min && length < min) || (max && length > max)) {
            return false;
        } else {
            return true;
        }
    }
Returns true if the given value is between the configured min and max values.
For example:

validations: [{type: 'length', field: 'name', min: 2}]

@param {Object} config Config object
@param {String} value The value to validate
@return {Boolean} True if the value passes validation