Skip to content

102 fix empty dependencies #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2021
Merged

102 fix empty dependencies #107

merged 1 commit into from
Feb 26, 2021

Conversation

salesh
Copy link
Contributor

@salesh salesh commented Feb 25, 2021

Description

#102

Currently, it's calling

_flattenNpmDepsTree (npmDepsTree, npmDepMap = {}) {
with 'undefined' (npmDepsTree) when there are no 'dependencies' in package-lock.json
const npmDepsTree = packageJsonParsed.dependencies
and that causes Object.entries(npmDepsTree) to break.

Solution:

If not undefined call _flattenNpmDepsTree else set empty object

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Related Issue

#102

Motivation and Context

How Has This Been Tested?

Locally

Screenshots (if appropriate):

Checklist:

  • I have updated the documentation (if required).
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I added a picture of a cute animal cause it's fun

Sorry, something went wrong.

@codecov-io
Copy link

codecov-io commented Feb 25, 2021

Codecov Report

Merging #107 (ff674c9) into master (d7564f8) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #107   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        11           
  Lines          237       237           
  Branches        41        42    +1     
=========================================
  Hits           237       237           
Impacted Files Coverage Δ
packages/lockfile-lint-api/src/ParseLockfile.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d7564f8...ff674c9. Read the comment docs.

@lirantal
Copy link
Owner

Thanks @salesh 🙏

@lirantal lirantal merged commit 1ab87a9 into lirantal:master Feb 26, 2021
@salesh salesh deleted the 102-fix-empty-dependencies-issue branch February 26, 2021 10:47
@salesh
Copy link
Contributor Author

salesh commented Feb 26, 2021

Always @lirantal glad to contribute whenever I see on Twitter/Github 🙃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants