src/utils.js
/**
 * Expands the passed glob and returns the resulting file paths that are filtered for files 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 file paths that are filtered for files 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 file paths that are filtered for files only . @returns { QPromise } A promise holding an array of file paths . @param { string } globExpression A glob expression .
function globFiles (globExpression) {
    return expandGlob(globExpression).then(function (filesAndFolders) {
        return Q.all(filesAndFolders.map(function (filePath) {
            return isFile(filePath).then(function (result) {
                if (result) return filePath;
                return undefined;
            });
        })).then(function (results) {
            return results.filter(function (result) {
                return result !== undefined;
            });
        });
    });
}
function globFiles ( globExpression ) { return expandGlob ( globExpression ) . then ( function ( filesAndFolders ) { return Q . all ( filesAndFolders . map ( function ( filePath ) { return isFile ( 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 file paths that are filtered for files only.
Expands the passed glob and returns the resulting file paths that are filtered for files only .