Skip to content

Commit

Permalink
fixed Fixed bug for case when no version set in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey.Kudashkin authored and Andrey.Kudashkin committed Dec 22, 2023
1 parent d61002e commit 7597b8a
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 5 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to the "npm-deps-security-advisories" extension will be docu

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [Unreleased]
## [0.0.1]

- Initial release
- Initial release

## [0.0.2]

- Fixed bug for case when no version set in package.json
- Added icon
202 changes: 202 additions & 0 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "npm-deps-security-advisories",
"displayName": "npm-deps-security-advisories",
"description": "This extension analyzes npm project dependencies and displays a list of packages with vulnerabilities, if any.",
"version": "0.0.1",
"version": "0.0.2",
"engines": {
"vscode": "^1.78.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/dependencies-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export const parseLockFileAsync = async (workspaceDir: string, manifestFile: str
};

const fillDepsMap = (subTree: DepTreeDep, target: Map<string, Dependency>, skipAddSelf = false): void => {
if (!subTree.name || !subTree.version) {
if (!skipAddSelf && (!subTree.name || !subTree.version)) {
return;
}

if (!skipAddSelf) {
const key = `${subTree.name}@${subTree.version}`;
target.set(key, { name: subTree.name, version: subTree.version });
target.set(key, { name: subTree.name!, version: subTree.version! });
}

if (subTree.dependencies) {
Expand Down

0 comments on commit 7597b8a

Please sign in to comment.