lib/utils/file.js
function isDir(abspath, found) {
    var stat       = fs.statSync(abspath),
        abspathAry = abspath.split('/'),
        data,
        file_name;

    if (!found) {
        found = {dirs: [], files: [] }
    }

    if (stat.isDirectory() && !isHidden(abspathAry[abspathAry.length - 1])) {
        found.dirs.push(abspath);

        /* If we found a directory, recurse! */
        data        = exports.readDirSync(abspath);
        found.dirs  = found.dirs.concat(data.dirs);
        found.files = found.files.concat(data.files);

    } else {

        abspathAry = abspath.split('/');
        file_name  = abspathAry[abspathAry.length - 1];

        if (!isHidden(file_name)) {
            found.files.push(abspath);
        }
    }
    return found;
}
function isDir(abspath, found) {
    var stat       = fs.statSync(abspath),
        abspathAry = abspath.split('/'),
        data,
        file_name;

    if (!found) {
        found = {dirs: [], files: [] }
    }

    if (stat.isDirectory() && !isHidden(abspathAry[abspathAry.length - 1])) {
        found.dirs.push(abspath);

        /* If we found a directory, recurse! */
        data        = exports.readDirSync(abspath);
        found.dirs  = found.dirs.concat(data.dirs);
        found.files = found.files.concat(data.files);

    } else {

        abspathAry = abspath.split('/');
        file_name  = abspathAry[abspathAry.length - 1];

        if (!isHidden(file_name)) {
            found.files.push(abspath);
        }
    }
    return found;
}
function isDir ( abspath , found ) { var stat = fs . statSync ( abspath ) , abspathAry = abspath . split ( '/' ) , data , file_name ; if ( ! found ) { found = { dirs : [ ] , files : [ ] } } if ( stat . isDirectory ( ) && ! isHidden ( abspathAry [ abspathAry . length - 1 ] ) ) { found . dirs . push ( abspath ) ; /* If we found a directory, recurse! */ data = exports . readDirSync ( abspath ) ; found . dirs = found . dirs . concat ( data . dirs ) ; found . files = found . files . concat ( data . files ) ; } else { abspathAry = abspath . split ( '/' ) ; file_name = abspathAry [ abspathAry . length - 1 ] ; if ( ! isHidden ( file_name ) ) { found . files . push ( abspath ) ; } } return found ; }
Identifies if the path is directory

@param  {String}  abspath   Absolute path, should be already have replaced '\' with '/' to support Windows
@param  {Object}  found     Object: {dirs: [], files: [] }, contains information about directory's files and subdirectories
@return {Object}            Updated 'found' object
Identifies if the path is directory