Internalize CPE generation logic (#2541)

* migrate CPE generation logic to internal

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* remove create function

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman
2024-01-26 12:16:05 -05:00
committed by GitHub
parent 7f90b8f1eb
commit b6cbf82389
36 changed files with 63 additions and 49 deletions
+3 -1
View File
@@ -8,6 +8,8 @@ import (
"github.com/facebookincubator/nvdtools/wfn"
)
const Any = ""
type CPE struct {
Part string
Vendor string
@@ -123,7 +125,7 @@ func normalizeField(field string) string {
// keep dashes and forward slashes unescaped
if field == "*" {
return wfn.Any
return Any
}
return stripSlashes(field)
}