Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Version

Version describes a Major.Minor.Patch version for use in semantic versioning.

export
class

Version

Hierarchy

  • Version

Index

Constructors

constructor

  • new Version(digits: number[]): Version
  • Creates a Version from a three-digit array.

    memberof

    Version

    Parameters

    • digits: number[]

    Returns Version

Properties

digits

digits: number[]

Methods

compare

  • Compares two versions. Returns -1 if the right version is newer than the left version. Returns 0 if the right version is equal to the left version. Returns 1 if the right version is older than the left version.

    memberof

    Version

    Parameters

    Returns number

equalTo

  • Returns whether this version is equal to another version.

    memberof

    Version

    Parameters

    Returns boolean

greaterThan

  • greaterThan(rhs: Version): boolean
  • Returns whether this version is greater than (i.e. newer than) another version.

    memberof

    Version

    Parameters

    Returns boolean

lessThan

  • Returns whether this version is less than (i.e. older than) another version.

    memberof

    Version

    Parameters

    Returns boolean

lessThanOrEqual

  • lessThanOrEqual(rhs: Version): boolean
  • Returns whether this version is less than (i.e. older than) or equal to another version.

    memberof

    Version

    Parameters

    Returns boolean

toString

  • toString(): string
  • Returns a string representing the version.

    memberof

    Version

    Returns string

Static fromString

  • fromString(version: string): Version
  • Parses a string and returns a Version.

    static
    memberof

    Version

    Parameters

    • version: string

    Returns Version

Generated using TypeDoc