diff --git a/packageurl.go b/packageurl.go index 0dd89a7..c0d46fc 100644 --- a/packageurl.go +++ b/packageurl.go @@ -566,7 +566,6 @@ func typeAdjustNamespace(purlType, ns string) string { TypeDebian, TypeGithub, TypeGolang, - TypeNPM, TypeRPM, TypeQpkg: return strings.ToLower(ns) @@ -586,8 +585,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, "_", "-")) diff --git a/packageurl_test.go b/packageurl_test.go index db4151b..9624228 100644 --- a/packageurl_test.go +++ b/packageurl_test.go @@ -515,12 +515,12 @@ func TestNormalize(t *testing.T) { }, { name: "known type namespace adjustments", input: packageurl.PackageURL{ - Type: "npm", + Type: "apk", Namespace: "NaMeSpAcE", Name: "pkg", }, want: packageurl.PackageURL{ - Type: "npm", + Type: "apk", Namespace: "namespace", Name: "pkg", Qualifiers: packageurl.Qualifiers{}, @@ -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{}, },