Clarify debug message for package.json omissions

Signed-off-by: Dan Luhring <dan.luhring@anchore.com>
This commit is contained in:
Dan Luhring 2021-01-22 15:20:24 -05:00
parent 9ec3ad58c8
commit d5779a9822
No known key found for this signature in database
GPG key ID: 9CEE23D079426CEF

View file

@ -174,9 +174,8 @@ func parsePackageJSON(_ string, reader io.Reader) ([]pkg.Package, error) {
return nil, fmt.Errorf("failed to parse package.json file: %w", err)
}
if !p.hasMinimumRequiredValues() {
log.Debug("encountered package.json file without the minimum number of field values required for" +
" consideration as a package")
if !p.hasNameAndVersionValues() {
log.Debug("encountered package.json file without a name and/or version field, ignoring this file")
return nil, nil
}
@ -204,6 +203,6 @@ func parsePackageJSON(_ string, reader io.Reader) ([]pkg.Package, error) {
return packages, nil
}
func (p PackageJSON) hasMinimumRequiredValues() bool {
func (p PackageJSON) hasNameAndVersionValues() bool {
return p.Name != "" && p.Version != ""
}