Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IVersion

A contract class that follows Semantic Versioning standards to manage your project's version.

export

Hierarchy

  • IVersion

Implemented by

Index

Methods

  • incrementMajor(): void
  • Increments the major number by one, and sets the minor and patch numbers to 0.

    Returns void

  • incrementMinor(): void
  • Increments the minor number by one, sets the patch number to 0 and does not update the major number.

    Returns void

  • incrementPatch(): void
  • Increments the patch number by one, and does not update the major and minor numbers.

    Returns void

  • resetBuild(): void
  • resetPreRelease(): void
  • setBuild(build: string): void
  • Sets the build suffix at the end of the version.

    Parameters

    • build: string

      the build suffix to add

    Returns void

  • setPreRelease(preRelease: string): void
  • Sets the pre-release suffix at the end of the version.

    Parameters

    • preRelease: string

      the pre-release suffix to add

    Returns void

  • toJSON(): string
  • toString(): string
  • Outputs the version in the SemVer format: <major>.<minor>.<patch> with optional pre-release (-<pre-release>) and build (+<build>) suffixes.

    Returns string

  • update(type: UpdateType, preRelease?: null | string, build?: null | string): void
  • Updates the version properly.

    Parameters

    • type: UpdateType

      the type of the update

    • Optional preRelease: null | string

      the value of the pre-release (optional)

    • Optional build: null | string

      the value of the build (optional)

    Returns void