Skip to content

Commit

Permalink
fix: typo in lockfile >= 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Aug 27, 2023
1 parent 2f9adff commit dda5564
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pnpm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func readLockData(lockData map[string]interface{}) ([]dependency, error) {
dep := dependency{}

var name, version, belonging string
if lockfileVersionNum > 6.0 {
if lockfileVersionNum >= 6.0 {
name, version, belonging = splitPackageNameAndVersionV6(pkgName)
} else {
name, version, belonging = splitPackageNameAndVersionLegacy(pkgName)
Expand Down
12 changes: 6 additions & 6 deletions pnpm/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ func TestListAllModules(t *testing.T) {
for _, mod := range mods {
if mod.Name == "axios" {
h := fmt.Sprintf("%x", sha256.Sum256([]byte(mod.Name)))
assert.Equal(t, "0.19.0", mod.Version)
assert.Equal(t, "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz", mod.PackageDownloadLocation)
assert.Equal(t, "0.19.2", mod.Version)
assert.Equal(t, "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", mod.PackageDownloadLocation)
assert.Equal(t, meta.HashAlgorithm("SHA256"), mod.Checksum.Algorithm)
assert.Equal(t, h, mod.Checksum.Value)
assert.Equal(t, "Copyright (c) 2014-present Matt Zabriskie", mod.Copyright)
Expand All @@ -116,8 +116,8 @@ func TestListAllModules(t *testing.T) {
}
h := fmt.Sprintf("%x", sha256.Sum256([]byte(mod.Name)))

assert.Equal(t, "16.8.6", mod.Version)
assert.Equal(t, "https://registry.npmjs.org/react/-/react-16.8.6.tgz", mod.PackageDownloadLocation)
assert.Equal(t, "16.14.0", mod.Version)
assert.Equal(t, "https://registry.npmjs.org/react/-/react-16.14.0.tgz", mod.PackageDownloadLocation)
assert.Equal(t, meta.HashAlgorithm("SHA256"), mod.Checksum.Algorithm)
assert.Equal(t, h, mod.Checksum.Value)
assert.Equal(t, "Copyright (c) Facebook, Inc. and its affiliates.", mod.Copyright)
Expand All @@ -128,8 +128,8 @@ func TestListAllModules(t *testing.T) {
if mod.Name == "react-dom" {
h := fmt.Sprintf("%x", sha256.Sum256([]byte(mod.Name)))

assert.Equal(t, "16.8.6", mod.Version)
assert.Equal(t, "https://registry.npmjs.org/react-dom/-/react-dom-16.8.6.tgz", mod.PackageDownloadLocation)
assert.Equal(t, "16.14.0", mod.Version)
assert.Equal(t, "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz", mod.PackageDownloadLocation)
assert.Equal(t, meta.HashAlgorithm("SHA256"), mod.Checksum.Algorithm)
assert.Equal(t, h, mod.Checksum.Value)
assert.Equal(t, "Copyright (c) Facebook, Inc. and its affiliates.", mod.Copyright)
Expand Down

0 comments on commit dda5564

Please sign in to comment.