From d2bcda7c0450f2d74a834a623d4147e0f567e8e0 Mon Sep 17 00:00:00 2001 From: Paul Mathews Date: Wed, 25 Sep 2024 08:59:43 +1000 Subject: [PATCH] npm names are case sensitive --- packageurl.go | 3 +-- packageurl_test.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packageurl.go b/packageurl.go index 0dd89a7..5177228 100644 --- a/packageurl.go +++ b/packageurl.go @@ -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, "_", "-")) diff --git a/packageurl_test.go b/packageurl_test.go index db4151b..6fa8c8d 100644 --- a/packageurl_test.go +++ b/packageurl_test.go @@ -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{}, },