Skip to content

Commit

Permalink
npm names are case sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
PFCM authored and shibumi committed Dec 15, 2024
1 parent 1f15199 commit d2bcda7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packageurl.go
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,7 @@ func typeAdjustName(purlType, name string, qualifiers Qualifiers) string {
TypeComposer,
TypeDebian,
TypeGithub,
TypeGolang,
TypeNPM:
TypeGolang:
return strings.ToLower(name)
case TypePyPi:
return strings.ToLower(strings.ReplaceAll(name, "_", "-"))
Expand Down
4 changes: 2 additions & 2 deletions packageurl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,11 +528,11 @@ func TestNormalize(t *testing.T) {
}, {
name: "known type name adjustments",
input: packageurl.PackageURL{
Type: "npm",
Type: "alpm",
Name: "nAmE",
},
want: packageurl.PackageURL{
Type: "npm",
Type: "alpm",
Name: "name",
Qualifiers: packageurl.Qualifiers{},
},
Expand Down

0 comments on commit d2bcda7

Please sign in to comment.