func NewReport(report []byte) (atypes.Report, error) {
	var r *Report
	if err := producers.ParseJSON(report, &r); err != nil {
		switch err.(type) {
		case *json.InvalidUTF8Error, *json.SyntaxError, *json.UnmarshalFieldError,
			*json.UnmarshalTypeError, *json.UnsupportedTypeError, *json.UnsupportedValueError:
			return nil, &atypes.ParsingError{
				Type:          "npm_quick_audit",
				PrintableType: PrintableType,
				Err:           err,
			}
		default:
			return nil, err
		}
	}
	if r.Version != 2 {
		return nil, &atypes.FormatError{
			Type:          "npm_quick_audit",
			PrintableType: PrintableType,
		}
	}
	return r, nil
}
NewReport constructs a Report from an npm Full Audit report.
package npmquickaudit
import (
	"encoding/json"
	"fmt"
	"log"
	"reflect"
	"strings"
	v1 "github.com/thought-machine/dracon/api/proto/v1"
	"github.com/thought-machine/dracon/producers"
	atypes "github.com/thought-machine/dracon/producers/npm_audit/types"
)
const PrintableType = "npm Quick Audit report"
type Report struct {
	PackagePath     string                   `json:"-"`
	Version         int                      `json:"auditReportVersion"`
	Vulnerabilities map[string]Vulnerability `json:"vulnerabilities"`
}
type Vulnerability struct {
	Package  string     `json:"name"`
	Severity string     `json:"severity"`
	Via      []Advisory `json:"via"`
	Effects  []string   `json:"effects"`
	Range    string     `json:"range"`
	Fix      Fix        `json:"fixAvailable"`
}
type Advisory struct {
	Transitive bool   `json:"-"`
	ID         int    `json:"source"`
	Package    string `json:"name"`
	Dependency string `json:"dependency"`
	Title      string `json:"title"`
	URL        string `json:"url"`
	Severity   string `json:"severity"`
	Range      string `json:"range"`
}
func (a *Advisory) UnmarshalJSON(data []byte) error {
	var packageName string
	if err := json.Unmarshal(data, &packageName); err == nil {
		*a = Advisory{
			Transitive: true,
			Package:    packageName,
			Dependency: packageName,
		}
		return nil
	}
	type tempAdvisory Advisory
	advisory := tempAdvisory{}
	if err := json.Unmarshal(data, &advisory); err == nil {
		newAdvisory := Advisory(advisory)
		newAdvisory.Transitive = false
		*a = newAdvisory
		return nil
	}
	return &json.UnmarshalTypeError{
		Value: "Advisory",
		Type:  reflect.TypeOf(a),
	}
}
type Fix struct {
	Available bool
	Package   string `json:"name"`
	Version   string `json:"version"`
	IsMajor   bool   `json:"isSemVerMajor"`
}
func (f *Fix) UnmarshalJSON(data []byte) error {
	var isAvailable bool
	if err := json.Unmarshal(data, &isAvailable); err == nil {
		*f = Fix{
			Available: isAvailable,
		}
		return nil
	}
	type tempFix Fix
	fix := tempFix{}
	if err := json.Unmarshal(data, &fix); err == nil {
		newFix := Fix(fix)
		newFix.Available = true
		*f = newFix
		return nil
	}
	return &json.UnmarshalTypeError{
		Value: "Fix",
		Type:  reflect.TypeOf(f),
	}
}