es5/src/read-dir.js
function filterFiles(files, recursive) {
    var fileOrDir = function fileOrDir(lstat) {
        return lstat.isFile() || lstat.isDirectory();
    };
    return files.filter(function (_ref) {
        var lstat = _ref.lstat;

        return recursive ? fileOrDir(lstat) : lstat.isFile();
    });
}
function filterFiles(files, recursive) {
    var fileOrDir = function fileOrDir(lstat) {
        return lstat.isFile() || lstat.isDirectory();
    };
    return files.filter(function (_ref) {
        var lstat = _ref.lstat;

        return recursive ? fileOrDir(lstat) : lstat.isFile();
    });
}
function filterFiles ( files , recursive ) { var fileOrDir = function fileOrDir ( lstat ) { return lstat . isFile ( ) || lstat . isDirectory ( ) ; } ; return files . filter ( function ( _ref ) { var lstat = _ref . lstat ; return recursive ? fileOrDir ( lstat ) : lstat . isFile ( ) ; } ) ; }
Filter lstat results, taking only files if recursive is false.
@param {lstat[]} files An array with lstat results
@param {boolean} [recursive = false] Whether recursive mode is on
@returns {lstat[]} Filtered array.
Filter lstat results taking only files if recursive is false .