Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
options: Options & TestOptions,
targetFiles: string[],
): Promise {
const allResults: ScannedProjectCustom[] = [];
for (const targetFile of targetFiles) {
const optionsClone = _.cloneDeep(options);
optionsClone.file = path.basename(targetFile);
optionsClone.packageManager = detectPackageManagerFromFile(
optionsClone.file,
);
try {
const inspectRes = await getSinglePluginResult(root, optionsClone);
let resultWithScannedProjects: cliInterface.legacyPlugin.MultiProjectResult;
if (!cliInterface.legacyPlugin.isMultiResult(inspectRes)) {
resultWithScannedProjects = {
plugin: inspectRes.plugin,
scannedProjects: [
{
depTree: inspectRes.package,
targetFile: inspectRes.plugin.targetFile,
meta: inspectRes.meta,
},
],
};
} else {
resultWithScannedProjects = inspectRes;
}
// annotate the package manager, project name & targetFile to be used
// for test & monitor