diff --git a/Changelog.md b/Changelog.md index 92999a8ba..c2c565a13 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # Spectrometer Changelog +## v2.19.7 + +- Resolves a regression when parsing npm `package-lock.json` files that do not contain a `version` field ([#445](https://github.com/fossas/spectrometer/pull/445)) + ## v2.19.6 - Special cases scans with a single VSI only filter to skip other analysis strategies ([#407](https://github.com/fossas/spectrometer/pull/407)) diff --git a/src/Strategy/Node/Npm/PackageLock.hs b/src/Strategy/Node/Npm/PackageLock.hs index 216bf6868..4e34f6618 100644 --- a/src/Strategy/Node/Npm/PackageLock.hs +++ b/src/Strategy/Node/Npm/PackageLock.hs @@ -29,7 +29,6 @@ import Strategy.Node.PackageJson (FlatDeps (directDeps), NodePackage (pkgName), data NpmPackageJson = NpmPackageJson { packageName :: Text - , packageVersion :: Text , packageDependencies :: Map Text NpmDep } deriving (Eq, Ord, Show) @@ -47,7 +46,6 @@ data NpmDep = NpmDep instance FromJSON NpmPackageJson where parseJSON = withObject "NpmPackageJson" $ \obj -> NpmPackageJson <$> obj .: "name" - <*> obj .: "version" <*> obj .: "dependencies" instance FromJSON NpmDep where diff --git a/test/Node/NpmLockSpec.hs b/test/Node/NpmLockSpec.hs index 1c714b461..ad89f972e 100644 --- a/test/Node/NpmLockSpec.hs +++ b/test/Node/NpmLockSpec.hs @@ -13,7 +13,6 @@ mockInput :: NpmPackageJson mockInput = NpmPackageJson { packageName = "example" - , packageVersion = "1.0.0" , packageDependencies = Map.fromList [