Documentation
¶
Index ¶
- func MaxSatisfying(versions []versions.Semver, c constraints.Constraint, includePreReleases bool) versions.Semver
- func MaxSatisfyingStrings(versions []string, c constraints.Constraint, includePreReleases bool) (versions.Semver, error)
- func ParseConstraint(constraintString string) (constraints.Constraint, error)
- func ParseSemver(versionLiteral string) (versions.Semver, error)
- func Satisfies(v versions.Semver, c constraints.Constraint, includePreReleases bool) bool
- func Sort(sortOrder int, versions []versions.Semver) []versions.Semver
- func SortStrings(sortOrder int, versionStrings []string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaxSatisfying ¶
func MaxSatisfying(versions []versions.Semver, c constraints.Constraint, includePreReleases bool) versions.Semver
Evaluates the given constraints for each provided version and returns the hightest version that satisfies this constraint (if any)
func MaxSatisfyingStrings ¶
func MaxSatisfyingStrings(versions []string, c constraints.Constraint, includePreReleases bool) (versions.Semver, error)
Evaluates the given constraints for each provided version and returns the hightest version that satisfies this constraint (if any) Equivalent to MaxSatisfying, but this function allows users to pass in versions as strings
func ParseConstraint ¶
func ParseConstraint(constraintString string) (constraints.Constraint, error)
Parses a given node semver constraint string into a constraint object
func ParseSemver ¶
Parses a semver string into a semver object
func Satisfies ¶
func Satisfies(v versions.Semver, c constraints.Constraint, includePreReleases bool) bool
Takes a version and semver constraint Returns true if the version satisfies the constraint and false otherwise
ex: constraint '>= 5.0.0' and version '5.0.0' would return true
As per node semver spec includePreReleases can be used to allow prerelease versions with different [major,minor,patch] tuple to satify the given constraint
ex: includePreReleases 'false' constraint '<= 5.0.0' and version '5.0.0-beta.2' would return true ex: includePreReleases 'false' constraint '<= 5.0.0' and version '4.0.0-beta.2' would return false ex: includePreReleases 'true' constraint '<= 5.0.0' and version '4.0.0-beta.2' would return true
Types ¶
This section is empty.