Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Version

This class represents the Version number format used by AntOS. A typical AntOS version number is in the following format:

[major_number].[minor_number].[patch]-[branch]

e.g.: 1.2.3-r means that:
- version major number is 1
- version minor number is 2
- patch version is 3
- the current branch is release `r`
export

Hierarchy

  • Version

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Version(string: string): Version
  • Creates an instance of Version.

    memberof

    Version

    Parameters

    • string: string

      string represents the version

    Returns Version

Properties

Private branch

branch: number

The current branch

  • 1: a - alpha branch
  • 2: b - beta branch
  • 3: r - release branch
memberof

Version

major

major: number

Version major number

memberof

Version

minor

minor: number

Version minor number

memberof

Version

patch

patch: number

Version patch number

memberof

Version

string

string: string

The version string

memberof

Version

Methods

__v

compare

  • compare(o: string | Version): 0 | 1 | -1
  • Compare the current version with another version.

    The comparison priority is branch>major>minor>patch.

    For the branch, the priority is r>b>a

    memberof

    Version

    Parameters

    • o: string | Version

      version string or object

    Returns 0 | 1 | -1

    Return 0 if the two versions are the same, 1 if the current version is newer than the input version, otherwise return -1

nt

  • Check if the current version is newer than the input version

    memberof

    Version

    Parameters

    • o: string | Version

      version string or object

    Returns boolean

ot

  • Check if the current version is older than the input version

    memberof

    Version

    Parameters

    • o: string | Version

      version string or object

    Returns boolean

toString

  • toString(): string