mirror of
https://github.com/anchore/syft.git
synced 2026-11-05 00:46:38 +01:00
Add dart support (#919)
Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
co-authored by
Alex Goodman
parent
f157d7a862
commit
cb3e73e308
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user