Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Version

Hierarchy

  • Version

Index

Constructors

constructor

  • new Version(major: number, minor: number, patch: number): Version
  • Parameters

    • major: number
    • minor: number
    • patch: number

    Returns Version

Properties

major

major: number

minor

minor: number

patch

patch: number

Methods

compare

  • Returns 0 if this version is equal to the other version. Returns a negative integer if this version is strictly smaller than the other version. Returns a positive integer if this version is strictly larger than the other version.

    Parameters

    Returns number

isAfter

  • Returns true if this version is strictly larger than the provided version.

    Parameters

    Returns boolean

isAfterOrEqual

  • isAfterOrEqual(other: Version): boolean
  • Parameters

    Returns boolean

isBefore

  • isBefore(other: Version): boolean
  • Returns true if this version is strictly smaller compared to the provided version.

    Parameters

    Returns boolean

isBeforeOrEqual

  • isBeforeOrEqual(other: Version): boolean
  • Parameters

    Returns boolean

isEqualTo

  • isEqualTo(other: Version): boolean
  • Parameters

    Returns boolean

toString

  • toString(): string
  • Returns string

Static parse

  • parse(versionString: string): Version
  • Parses and @returns the given string as a Version object.

    This function is memoised to keep memory and time consumption low, given that only a handful of versions exist at any time anyway.

    Parameters

    • versionString: string

    Returns Version

Generated using TypeDoc