src/utils.js
/**
 * Expands the passed glob and returns the resulting directory paths that are filtered for directories only.
 *
 * @returns {QPromise} A promise holding an array of file paths.
 * @param {string} globExpression A glob expression.
 */
Expands the passed glob and returns the resulting directory paths that are filtered for directories only.
@returns {QPromise} A promise holding an array of file paths.
@param {string} globExpression A glob expression.
Expands the passed glob and returns the resulting directory paths that are filtered for directories only . @returns { QPromise } A promise holding an array of file paths . @param { string } globExpression A glob expression .
function globDirectories (globExpression) {
    return expandGlob(globExpression).then(function (filesAndFolders) {
        return Q.all(filesAndFolders.map(function (filePath) {
            return isDirectory(filePath).then(function (result) {
                if (result) return filePath;
                return undefined;
            });
        })).then(function (results) {
            return results.filter(function (result) {
                return result !== undefined;
            });
        });
    });
}
function globDirectories ( globExpression ) { return expandGlob ( globExpression ) . then ( function ( filesAndFolders ) { return Q . all ( filesAndFolders . map ( function ( filePath ) { return isDirectory ( filePath ) . then ( function ( result ) { if ( result ) return filePath ; return undefined ; } ) ; } ) ) . then ( function ( results ) { return results . filter ( function ( result ) { return result !== undefined ; } ) ; } ) ; } ) ; }
Expands the passed glob and returns the resulting directory paths that are filtered for directories only.
Expands the passed glob and returns the resulting directory paths that are filtered for directories only .