_.forEach(path, function(pathValue, idx){
            // Set the current path
            var currentDepthNode = network[pathValue - 1]; // get the corresponding node
            var nextNodeOnPath = network[path[idx + 1] - 1];

            _currentNode = currentDepthNode;
            _s.push(_currentNode);

            _v[_s.length - 1] = _.filter(currentDepthNode.getVertices(), function(child){
                return child != nextNodeOnPath && !_.contains(_s, child) && idx < path.length - 1;
            });
        });
Example #2
0
		async.parallel(roots.map(curry2(dir.files)), function (err, sourceMatrix) {
			// if there was an error, throw it further
			if (err) return callback(err);
			// concatenate separate lists of file names from different roots
			var sourceList = _.flatten(sourceMatrix, true);
			// in case one root is inside another
			sourceList = _.uniq(sourceList);
			// in case some source files are inside roots
			sourceList = _.difference(sourceList, jsSources);
			// delete all non-js files
			sourceList = _.filter(sourceList, curry2(hasExtension)('js'));
			// add source file paths (for temporary files) into the mix 
			sourceList = sourceList.concat(saved.js);
			// return it
			callback(null, sourceList);
		});
Example #3
0
				], function (err, result) {
					var repoUrl, robots, repoUrlResultRow, buildStatus = {
						friendlyName: 'unknown',
						className: 'unknown'
					};
					if(err) {
						res.status(500).send({
							messsage: 'Postgres error',
							details: err
						});
					} else {
						robots = _.filter(result.rows, function (row) {
							return !!row.class;
						});
						if(robots.length > 1) {
							console.warn('More than one robot found for user: '******'FAILED_MAVEN':
								buildStatus.className = 'red';
								buildStatus.friendlyName = 'maven';
								break;
							case 'FAILED_GIT':
								buildStatus.className = 'red';
								buildStatus.friendlyName = 'git';
								break;
							case 'SUCCESS': 
								buildStatus.className = 'green';
								buildStatus.friendlyName = 'passing';
								break;
						}
						res.send({
							robot: robot,
							repoUrl: repoUrl,
							buildStatus: buildStatus
						});
					}
				});
Example #4
0
exports.filter = function (req, res) {
    var filter = req.query;
    var results = _.filter(customers, function (item) {
        var key,
            str;
        for (key in filter) {
            if (filter.hasOwnProperty((key))) {
                if (typeof  filter[key] === 'string') {
                    str = filter[key].toUpperCase();
                    if (item[key].toUpperCase().indexOf(str) !== -1) {
                        return true;
                    }
                }
            }
        }
        return false;
    });
    res.json(results);
};
Example #5
0
// sync
function selectFilesSync( filesArr ) {
    return _.filter( filesArr, function( fileName ) {
        return fileName.match( /.html$/i ) != null;
    } );
}