lib/filesets.js
function validateFileset(fileset, setter) {
    if (Array.isArray(fileset)) {
        async.each(fileset, function(path, callback) {
            if (typeof path === 'string') {
                callback();
            } else {
                callback(util.format('Invalid path: %s', path));
            }
        }, function(err) {
            if (err) {
                console.log(chalk.red(err));
            } else {
                setter(fileset);
            }
        });
    } else {
        console.log(chalk.red('Fileset is not an array: %j'), fileset);
    }
}
function validateFileset(fileset, setter) {
    if (Array.isArray(fileset)) {
        async.each(fileset, function(path, callback) {
            if (typeof path === 'string') {
                callback();
            } else {
                callback(util.format('Invalid path: %s', path));
            }
        }, function(err) {
            if (err) {
                console.log(chalk.red(err));
            } else {
                setter(fileset);
            }
        });
    } else {
        console.log(chalk.red('Fileset is not an array: %j'), fileset);
    }
}
function validateFileset ( fileset , setter ) { if ( Array . isArray ( fileset ) ) { async . each ( fileset , function ( path , callback ) { if ( typeof path === 'string' ) { callback ( ) ; } else { callback ( util . format ( 'Invalid path: %s' , path ) ) ; } } , function ( err ) { if ( err ) { console . log ( chalk . red ( err ) ) ; } else { setter ( fileset ) ; } } ) ; } else { console . log ( chalk . red ( 'Fileset is not an array: %j' ) , fileset ) ; } }
Filesets are validated by ensuring the fileset is an array and each item is a string. Valid filesets are applied, invalid ones are ignored.
Filesets are validated by ensuring the fileset is an array and each item is a string . Valid filesets are applied invalid ones are ignored .