Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VersionInfo

Hierarchy

  • VersionInfo

Index

Methods

Static Deserialize

Static from

  • Create a version from an encoded integer.

    example
    const version = VersionInfo.from(50532300);
    
    console.log(version.toString()); // => 2021.4.25
    

    Parameters

    • version: number

      The integer.

    Returns VersionInfo

  • Create a version from a formatted string.

    example
    const version = VersionInfo.from("2021.4.25s");
    
    console.log(version.toString()); // => 2021.4.25
    

    Parameters

    • version: string

      The formatted string.

    Returns VersionInfo

  • Parameters

    • version: string | number

    Returns VersionInfo

Serialize

encode

  • encode(): number
  • Encode the version as an integer.

    example
    const version = new VersionInfo(2021, 4, 2);
    
    console.log(version.encode()); // => 50532300
    

    Returns number

    The version as an integer.

toString

  • toString(): string
  • Convert the version into a human-readable string format.

    example
    const version = new VersionInfo(2021, 4, 2);
    
    console.log(version.toString()); // => 2021.4.25
    

    Returns string

    The version as a string.

Constructors

constructor

  • new VersionInfo(year: number, month: number, day: number, revision?: number): VersionInfo

Properties

day

day: number

month

month: number

revision

revision: number

year

year: number

Generated using TypeDoc