Skip to content

Commit

Permalink
Preserve case for NPM packages (anchore#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
kzantow authored Mar 14, 2022
2 parents 4361a00 + d22039c commit 1bcd40e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packageurl.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ func FromString(purl string) (PackageURL, error) {
// See https://github.com/package-url/purl-spec#known-purl-types
func typeAdjustNamespace(purlType, ns string) string {
switch purlType {
case TypeBitbucket, TypeDebian, TypeGithub, TypeGolang, TypeNPM, TypeRPM:
case TypeBitbucket, TypeDebian, TypeGithub, TypeGolang, TypeRPM:
return strings.ToLower(ns)
}
return ns
Expand All @@ -356,7 +356,7 @@ func typeAdjustNamespace(purlType, ns string) string {
// See https://github.com/package-url/purl-spec#known-purl-types
func typeAdjustName(purlType, name string) string {
switch purlType {
case TypeBitbucket, TypeDebian, TypeGithub, TypeGolang, TypeNPM:
case TypeBitbucket, TypeDebian, TypeGithub, TypeGolang:
return strings.ToLower(name)
case TypePyPi:
return strings.ToLower(strings.ReplaceAll(name, "_", "-"))
Expand Down

0 comments on commit 1bcd40e

Please sign in to comment.