Skip to content

Commit

Permalink
Reduce validation errors
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Jan 20, 2025
1 parent 5b4c4bd commit 74ebbbf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
24 changes: 22 additions & 2 deletions lib/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4928,12 +4928,32 @@ export async function parsePyLockData(lockData, lockFile, pyProjectFile) {
depsMap[pkgParentRef].add(pkg["bom-ref"]);
}
}
const devDependencies = apkg?.["dev-dependencies"]?.dev || [];
if (apkg.dependencies || devDependencies.length) {
let optionalDependencies = [];
let devDependencies = [];
if (apkg["dev-dependencies"]) {
for (const agroup of Object.keys(apkg["dev-dependencies"])) {
devDependencies = devDependencies.concat(
apkg["dev-dependencies"][agroup],
);
}
}
if (apkg["optional-dependencies"]) {
for (const agroup of Object.keys(apkg["optional-dependencies"])) {
optionalDependencies = optionalDependencies.concat(
apkg["optional-dependencies"][agroup],
);
}
}
if (
apkg.dependencies ||
devDependencies.length ||
optionalDependencies.length
) {
if (Array.isArray(apkg.dependencies)) {
// pdm.lock files
let allDeps = apkg.dependencies;
allDeps = allDeps.concat(devDependencies);
allDeps = allDeps.concat(optionalDependencies);
for (const apkgDep of allDeps) {
// Example: "msgpack>=0.5.2"
const nameStr =
Expand Down
2 changes: 1 addition & 1 deletion types/lib/helpers/utils.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 74ebbbf

Please sign in to comment.