Documentation
¶
Overview ¶
Package metadata defines a metadata struct for Javascript packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JavascriptPackageJSONMetadata ¶
type JavascriptPackageJSONMetadata struct {
Author *Person `json:"author"`
Maintainers []*Person `json:"maintainers"`
Contributors []*Person `json:"contributors"`
// FromNPMRepository field is annotated by the misc/from-npm annotator by parsing the lockfile
// of the root-level directory. This field is used to indicate whether this package's dependency
// was resolved from the official NPM registry during installation. If false, it means the package
// was either installed from a local path, a git repository, or another private registry.
// This is to identify name collisions between locally published packages and official NPM packages.
FromNPMRepository bool
}
JavascriptPackageJSONMetadata holds parsing information for a javascript package.json file.
func ToStruct ¶
func ToStruct(m *pb.JavascriptPackageJSONMetadata) *JavascriptPackageJSONMetadata
ToStruct converts the JavascriptPackageJSONMetadata proto to a Metadata struct.
func (*JavascriptPackageJSONMetadata) SetProto ¶
func (m *JavascriptPackageJSONMetadata) SetProto(p *pb.Package)
SetProto sets the JavascriptMetadata field in the Package proto.
type Person ¶
type Person struct {
Name string `json:"name"`
Email string `json:"email"`
URL string `json:"url"`
}
Person represents a person field in a javascript package.json file.
func PersonFromString ¶
PersonFromString parses a string of the form "name <email> (url)" into a Person struct.
func (*Person) PersonString ¶
PersonString produces a string format of Person struct in the format of "name <email> (url)"
func (*Person) UnmarshalJSON ¶
UnmarshalJSON parses a JSON object or string into a Person struct.
Click to show internal directories.
Click to hide internal directories.