gleamoire/version

Types

The result of version resolution

pub type ResolvedVersion {
  Unresolved
  Specified(Version)
  Resolved(Version)
}

Constructors

  • Unresolved

    The version could not be resolved, so default to the latest

  • Specified(Version)

    The version was specified explicitly by the user, so no resolution was required

  • Resolved(Version)

    The version could be determined using version resolution

pub type Version {
  Version(major: Int, minor: Int, patch: Int)
}

Constructors

  • Version(major: Int, minor: Int, patch: Int)

Functions

pub fn max(v1: Version, v2: Version) -> Version

Returns the higher of two versions.

pub fn max_of(versions: List(Version)) -> Result(Version, Nil)

Returns the highest version out of a list of version numbers. Returns Error if passed an empty list

pub fn parse(str: String) -> Result(Version, Error)

Parses a semver string into a Version.

pub fn to_option(v: ResolvedVersion) -> Option(Version)
pub fn to_string(version: Version) -> String

Converts a Version into a semver string.

Search Document