evaluator

package
v0.0.6-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL