Documentation
¶
Index ¶
- type DependencyFields
- type Expected
- type ExportsOrImports
- func (e ExportsOrImports) AsArray() []ExportsOrImports
- func (e ExportsOrImports) AsObject() *collections.OrderedMap[string, ExportsOrImports]
- func (e ExportsOrImports) IsConditions() bool
- func (e ExportsOrImports) IsImports() bool
- func (e ExportsOrImports) IsSubpaths() bool
- func (e *ExportsOrImports) UnmarshalJSONFrom(dec *jsontext.Decoder) error
- type Fields
- type HeaderFields
- type InfoCache
- type InfoCacheEntry
- type JSONValue
- type JSONValueType
- type PackageJson
- type PathFields
- type TypeValidatedField
- type VersionPaths
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DependencyFields ¶
type DependencyFields struct {
Dependencies Expected[map[string]string] `json:"dependencies"`
DevDependencies Expected[map[string]string] `json:"devDependencies"`
PeerDependencies Expected[map[string]string] `json:"peerDependencies"`
OptionalDependencies Expected[map[string]string] `json:"optionalDependencies"`
}
func (*DependencyFields) HasDependency ¶
func (df *DependencyFields) HasDependency(name string) bool
HasDependency returns true if the package.json has a dependency with the given name under any of the dependency fields (dependencies, devDependencies, peerDependencies, optionalDependencies).
type Expected ¶
type Expected[T any] struct { Null bool Valid bool Value T // contains filtered or unexported fields }
func ExpectedOf ¶
func (*Expected[T]) ActualJSONType ¶
func (*Expected[T]) ExpectedJSONType ¶
func (*Expected[T]) UnmarshalJSON ¶
type ExportsOrImports ¶
type ExportsOrImports struct {
JSONValue
// contains filtered or unexported fields
}
func (ExportsOrImports) AsArray ¶
func (e ExportsOrImports) AsArray() []ExportsOrImports
func (ExportsOrImports) AsObject ¶
func (e ExportsOrImports) AsObject() *collections.OrderedMap[string, ExportsOrImports]
func (ExportsOrImports) IsConditions ¶
func (e ExportsOrImports) IsConditions() bool
func (ExportsOrImports) IsImports ¶
func (e ExportsOrImports) IsImports() bool
func (ExportsOrImports) IsSubpaths ¶
func (e ExportsOrImports) IsSubpaths() bool
func (*ExportsOrImports) UnmarshalJSONFrom ¶
func (e *ExportsOrImports) UnmarshalJSONFrom(dec *jsontext.Decoder) error
type Fields ¶
type Fields struct {
HeaderFields
PathFields
DependencyFields
}
type HeaderFields ¶
type InfoCache ¶
type InfoCache struct {
// contains filtered or unexported fields
}
func NewInfoCache ¶
func (*InfoCache) Get ¶
func (p *InfoCache) Get(packageJsonPath string) *InfoCacheEntry
func (*InfoCache) Set ¶
func (p *InfoCache) Set(packageJsonPath string, info *InfoCacheEntry) *InfoCacheEntry
type InfoCacheEntry ¶
type InfoCacheEntry struct {
PackageDirectory string
DirectoryExists bool
Contents *PackageJson
}
func (*InfoCacheEntry) Exists ¶
func (p *InfoCacheEntry) Exists() bool
func (*InfoCacheEntry) GetContents ¶
func (p *InfoCacheEntry) GetContents() *PackageJson
func (*InfoCacheEntry) GetDirectory ¶
func (p *InfoCacheEntry) GetDirectory() string
type JSONValue ¶
type JSONValue struct {
Type JSONValueType
Value any
}
func (JSONValue) AsObject ¶
func (v JSONValue) AsObject() *collections.OrderedMap[string, JSONValue]
type JSONValueType ¶
type JSONValueType int8
const ( JSONValueTypeNotPresent JSONValueType = iota JSONValueTypeNull JSONValueTypeString JSONValueTypeNumber JSONValueTypeBoolean JSONValueTypeArray JSONValueTypeObject )
func (JSONValueType) String ¶
func (t JSONValueType) String() string
type PackageJson ¶
func (*PackageJson) GetVersionPaths ¶
func (p *PackageJson) GetVersionPaths(trace func(string)) VersionPaths
type PathFields ¶
type PathFields struct {
TSConfig Expected[string] `json:"tsconfig"`
Main Expected[string] `json:"main"`
Types Expected[string] `json:"types"`
Typings Expected[string] `json:"typings"`
TypesVersions JSONValue `json:"typesVersions"`
Imports ExportsOrImports `json:"imports"`
Exports ExportsOrImports `json:"exports"`
}
type TypeValidatedField ¶
type VersionPaths ¶
type VersionPaths struct {
Version string
// contains filtered or unexported fields
}
func (*VersionPaths) Exists ¶
func (v *VersionPaths) Exists() bool
func (*VersionPaths) GetPaths ¶
func (v *VersionPaths) GetPaths() *collections.OrderedMap[string, []string]
Click to show internal directories.
Click to hide internal directories.