node_modules/snyk/dist/cli/293.index.js
// Internal function to allow us to track the recursion depth.
Internal function to allow us to track the recursion depth.
Internal function to allow us to track the recursion depth .
function* walk(dirpath, currentDepth) {
        const filenames = fs.readdirSync(dirpath);
        for (const filename of filenames) {
            if (!options.includeDotfiles && filename.startsWith('.')) {
                continue;
            }
            const resolved = path_1.resolve(dirpath, filename);
            if (isDirectory(resolved)) {
                if (options.maxDepth === currentDepth) {
                    continue;
                }
                yield* walk(resolved, currentDepth + 1);
            }
            else {
                yield resolved;
            }
        }
    }
function * walk ( dirpath , currentDepth ) { const filenames = fs . readdirSync ( dirpath ) ; for ( const filename of filenames ) { if ( ! options . includeDotfiles && filename . startsWith ( '.' ) ) { continue ; } const resolved = path_1 . resolve ( dirpath , filename ) ; if ( isDirectory ( resolved ) ) { if ( options . maxDepth === currentDepth ) { continue ; } yield * walk ( resolved , currentDepth + 1 ) ; } else { yield resolved ; } } }
Internal function to allow us to track the recursion depth.
Internal function to allow us to track the recursion depth .
// NOTE: We filter filenames that start with a period to maintain // backwards compatibility with the original implementation that used the // "glob" package. // Skip this directory if max depth has been reached.