snyk-docker-plugin
Version:
Snyk CLI docker plugin
21 lines (20 loc) • 1.45 kB
TypeScript
import * as lockFileParser from "snyk-nodejs-lockfile-parser";
import { NodeLockfileVersion } from "snyk-nodejs-lockfile-parser";
import { NodeModulesPackagePath } from "../types";
import { AppDepsScanResultWithoutTarget, FilePathToContent, FilesByDirMap } from "./types";
export declare function nodeFilesToScannedProjects(filePathToContent: FilePathToContent, shouldIncludeNodeModules: boolean, collectOwnershipPaths?: boolean): Promise<AppDepsScanResultWithoutTarget[]>;
/**
* Collect the on-disk install directory of each package under a project's
* node_modules, from the image paths already gathered for the scan. Used to
* resolve per-package APK ownership downstream (response-builder), since the
* scan result itself only records the shared node_modules root. Skips pnpm/.bin
* virtual entries and any package.json without a name+version.
*/
export declare function collectNodeModulesPackagePaths(project: string, fileNamesGroupedByDirectory: FilesByDirMap, filePathToContent: FilePathToContent): NodeModulesPackagePath[];
export interface LockFileInfo {
path: string;
type: lockFileParser.LockfileType;
}
export declare function detectLockFile(directoryPath: string, filesInDirectory: Set<string>): LockFileInfo | null;
export declare function getLockFileVersion(lockFilePath: string, lockFileContents: string): NodeLockfileVersion;
export declare function shouldBuildDepTree(lockfileVersion: NodeLockfileVersion): boolean;