utils/validation.js
function getSchema(path) {
        var parts = path.split('.');
        var collectionName = parts[0];
        var fieldName = parts[1];

        // if format not user.field or field not in the schemaDefinitions object, then log error without breaking
        if (parts.length !== 2 || !schemaDefinitions[collectionName] || !schemaDefinitions[collectionName][fieldName]) {
            log.error('No schemaDefinitions for : ' + path, null);
            return {};
        }

        return schemaDefinitions[collectionName][fieldName];
    }
function getSchema(path) {
        var parts = path.split('.');
        var collectionName = parts[0];
        var fieldName = parts[1];

        // if format not user.field or field not in the schemaDefinitions object, then log error without breaking
        if (parts.length !== 2 || !schemaDefinitions[collectionName] || !schemaDefinitions[collectionName][fieldName]) {
            log.error('No schemaDefinitions for : ' + path, null);
            return {};
        }

        return schemaDefinitions[collectionName][fieldName];
    }
function getSchema ( path ) { var parts = path . split ( '.' ) ; var collectionName = parts [ 0 ] ; var fieldName = parts [ 1 ] ; // if format not user.field or field not in the schemaDefinitions object, then log error without breaking if ( parts . length !== 2 || ! schemaDefinitions [ collectionName ] || ! schemaDefinitions [ collectionName ] [ fieldName ] ) { log . error ( 'No schemaDefinitions for : ' + path , null ) ; return { } ; } return schemaDefinitions [ collectionName ] [ fieldName ] ; }
Take a string like user.password and get the schemaDefinitions for it
@param path
@returns {*}
Take a string like user . password and get the schemaDefinitions for it