src/utils/directory.js
function readRecursive(repoState, dirName) {
    // TODO improve performance and don't use .read() directly
    const files = read(repoState, dirName);

    let filesInDirs = files
        .filter((file) => {
            return file.isDirectory();
        })
        .map((dir) => {
            return readRecursive(repoState, dir.path);
        });

    filesInDirs = flatten(filesInDirs);

    return Array.prototype.concat(files, filesInDirs);
}
function readRecursive(repoState, dirName) {
    // TODO improve performance and don't use .read() directly
    const files = read(repoState, dirName);

    let filesInDirs = files
        .filter((file) => {
            return file.isDirectory();
        })
        .map((dir) => {
            return readRecursive(repoState, dir.path);
        });

    filesInDirs = flatten(filesInDirs);

    return Array.prototype.concat(files, filesInDirs);
}
List files and directories in a directory (recursive).
Warning: This recursive implementation is very costly.
@param {RepositoryState} repoState
@param {Path} dirName
@return {Array<File>}