mirror of
https://github.com/anchore/syft.git
synced 2026-02-15 03:56:40 +01:00
Signed-off-by: Nathan Voss <njvoss299@gmail.com> Signed-off-by: Keith Zantow <kzantow@gmail.com> Co-authored-by: Keith Zantow <kzantow@gmail.com>
34 lines
999 B
Go
34 lines
999 B
Go
package javascript
|
|
|
|
const npmBaseURL = "https://registry.npmjs.org"
|
|
|
|
type CatalogerConfig struct {
|
|
SearchRemoteLicenses bool `json:"search-remote-licenses" yaml:"search-remote-licenses" mapstructure:"search-remote-licenses"`
|
|
NPMBaseURL string `json:"npm-base-url" yaml:"npm-base-url" mapstructure:"npm-base-url"`
|
|
IncludeDevDependencies bool `json:"include-dev-dependencies" yaml:"include-dev-dependencies" mapstructure:"include-dev-dependencies"`
|
|
}
|
|
|
|
func DefaultCatalogerConfig() CatalogerConfig {
|
|
return CatalogerConfig{
|
|
SearchRemoteLicenses: false,
|
|
NPMBaseURL: npmBaseURL,
|
|
}
|
|
}
|
|
|
|
func (j CatalogerConfig) WithSearchRemoteLicenses(input bool) CatalogerConfig {
|
|
j.SearchRemoteLicenses = input
|
|
return j
|
|
}
|
|
|
|
func (j CatalogerConfig) WithNpmBaseURL(input string) CatalogerConfig {
|
|
if input != "" {
|
|
j.NPMBaseURL = input
|
|
}
|
|
return j
|
|
}
|
|
|
|
func (j CatalogerConfig) WithIncludeDevDependencies(input bool) CatalogerConfig {
|
|
j.IncludeDevDependencies = input
|
|
return j
|
|
}
|