Documentation
¶
Index ¶
- func MaxSatisfying(versions []versionTypes.Semver, c constraints.Constraint, ...) versionTypes.Semver
- func MaxSatisfyingStrings(versions []string, c constraints.Constraint, includePreReleases bool) (versionTypes.Semver, error)
- func Satisfies(v versionTypes.Semver, c constraints.Constraint, includePreReleases bool) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MaxSatisfying ¶
func MaxSatisfying(versions []versionTypes.Semver, c constraints.Constraint, includePreReleases bool) versionTypes.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) (versionTypes.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 Satisfies ¶
func Satisfies(v versionTypes.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.
Click to show internal directories.
Click to hide internal directories.