Add dart support (#919)

Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Eric Larssen
2022-03-31 15:44:55 -04:00
committed by GitHub
co-authored by Alex Goodman
parent f157d7a862
commit cb3e73e308
25 changed files with 1690 additions and 10 deletions
+6
View File
@@ -20,6 +20,7 @@ const (
GoModulePkg Type = "go-module"
RustPkg Type = "rust-crate"
KbPkg Type = "msrc-kb"
DartPubPkg Type = "dart-pub"
)
// AllPkgs represents all supported package types
@@ -36,6 +37,7 @@ var AllPkgs = []Type{
GoModulePkg,
RustPkg,
KbPkg,
DartPubPkg,
}
// PackageURLType returns the PURL package type for the current package.
@@ -61,6 +63,8 @@ func (t Type) PackageURLType() string {
return packageurl.TypeGolang
case RustPkg:
return "cargo"
case DartPubPkg:
return packageurl.TypePub
default:
// TODO: should this be a "generic" purl type instead?
return ""
@@ -98,6 +102,8 @@ func TypeByName(name string) Type {
return GemPkg
case "cargo", "crate":
return RustPkg
case packageurl.TypePub:
return DartPubPkg
default:
return UnknownPkg
}