snyk
Version:
snyk library and cli utility
19 lines (18 loc) • 1.19 kB
TypeScript
/**
* makeFileAndDirectoryGenerator is a generator function that helps walking the directory and file structure of this pathToScan
* @param root
* @param maxDepth? - An optional `maxDepth` argument can be provided to limit how deep in the file tree the search will go.
* @returns {Generator<object>} - a generator which yields an object with directories or paths for the path to scan
*/
export declare function makeFileAndDirectoryGenerator(root?: string, maxDepth?: number): Generator<any, void, any>;
export declare const getExtensionForPath: (pathToScan: string) => string;
export declare const shouldBeParsed: (pathToScan: string) => boolean;
export declare const isSingleFile: (pathToScan: string) => boolean;
/**
* Checks if a file should be ignored from loading or not according to the filetype.
* We ignore the same files that Terraform ignores.
* https://github.com/hashicorp/terraform/blob/dc63fda44b67300d5161dabcd803426d0d2f468e/internal/configs/parser_config_dir.go#L137-L143
* @param {string} pathToScan - The filepath to check
* @returns {boolean} if the filepath should be ignored or not
*/
export declare function isIgnoredFile(pathToScan: string): boolean;