@ui5/project/specifications/utils/SpecificationVersion

@ui5/project/specifications/utils/SpecificationVersion

Helper class representing a Specification Version. Featuring helper functions for easy comparison of versions.

Constructor

new @ui5/project/specifications/utils/SpecificationVersion(specVersion)

Source:
Parameters:
Name Type Description
specVersion string Specification Version to use for all comparison operations
Throws:
Throws if provided Specification Version is not supported by this version of @ui5/project
Type
Error

Methods

eq(testVersion) → {boolean}

Description:
  • Test whether the instance's Specification Version is equal to the provided test version
Source:
Parameters:
Name Type Description
testVersion string A Specification Version to compare the instance's Specification Version to
Returns:
True if the instance's Specification Version is equal to the provided version
Type
boolean

gt(testVersion) → {boolean}

Description:
  • Test whether the instance's Specification Version is greater than the provided test version
Source:
Parameters:
Name Type Description
testVersion string A Specification Version to compare the instance's Specification Version to
Returns:
True if the instance's Specification Version is greater than the provided version
Type
boolean

gte(testVersion) → {boolean}

Description:
  • Test whether the instance's Specification Version is greater than or equal to the provided test version
Source:
Parameters:
Name Type Description
testVersion string A Specification Version to compare the instance's Specification Version to
Returns:
True if the instance's Specification Version is greater than or equal to the provided version
Type
boolean

lt(testVersion) → {boolean}

Description:
  • Test whether the instance's Specification Version is smaller than the provided test version
Source:
Parameters:
Name Type Description
testVersion string A Specification Version to compare the instance's Specification Version to
Returns:
True if the instance's Specification Version is smaller than the provided version
Type
boolean

lte(testVersion) → {boolean}

Description:
  • Test whether the instance's Specification Version is smaller than or equal to the provided test version
Source:
Parameters:
Name Type Description
testVersion string A Specification Version to compare the instance's Specification Version to
Returns:
True if the instance's Specification Version is smaller than or equal to the provided version
Type
boolean

major() → {integer}

Description:
  • Returns the major-version of the instance's Specification Version
Source:
Returns:
Major version
Type
integer

minor() → {integer}

Description:
  • Returns the minor-version of the instance's Specification Version
Source:
Returns:
Minor version
Type
integer

neq(testVersion) → {boolean}

Description:
  • Test whether the instance's Specification Version is not equal to the provided test version
Source:
Parameters:
Name Type Description
testVersion string A Specification Version to compare the instance's Specification Version to
Returns:
True if the instance's Specification Version is not equal to the provided version
Type
boolean

satisfies(range) → {boolean}

Description:
  • Test whether the instance's Specification Version falls into the provided range
Source:
Parameters:
Name Type Description
range string Semver-style version range, for example 2.2 - 2.4 or =3.0
Returns:
True if the instance's Specification Version falls into the provided range
Type
boolean

toString() → {string}

Description:
  • Returns the Specification Version
Source:
Returns:
Specification Version
Type
string

(static) eq(specVersion, testVersion) → {boolean}

Description:
  • Test whether the provided Specification Version is equal to the provided test version
Source:
Parameters:
Name Type Description
specVersion string Specification Version
testVersion string A Specification Version to compare the provided Specification Version to
Returns:
True if the provided Specification Version is equal to the provided version
Type
boolean

(static) getVersionsForRange(range) → {Array.<string>}

Description:
  • Creates an array of Specification Versions that match with the provided range. This is mainly used for testing purposes. I.e. to execute identical tests for a range of specification versions.
Source:
Parameters:
Name Type Description
range string Semver-style version range, for example 2.2 - 2.4 or =3.0
Returns:
Array of versions that match the specified range
Type
Array.<string>

(static) gt(specVersion, testVersion) → {boolean}

Description:
  • Test whether the provided Specification Version is greater than the provided test version
Source:
Parameters:
Name Type Description
specVersion string Specification Version
testVersion string A Specification Version to compare the provided Specification Version to
Returns:
True if the provided Specification Version is greater than the provided version
Type
boolean

(static) gte(specVersion, testVersion) → {boolean}

Description:
  • Test whether the provided Specification Version is greater than or equal to the provided test version
Source:
Parameters:
Name Type Description
specVersion string Specification Version
testVersion string A Specification Version to compare the provided Specification Version to
Returns:
True if the provided Specification Version is greater than or equal to the provided version
Type
boolean

(static) isSupportedSpecVersion(testVersion) → {boolean}

Description:
  • Test whether the provided Specification Version is supported by this version of @ui5/project
Source:
Parameters:
Name Type Description
testVersion string A Specification Version to compare the instance's Specification Version to
Returns:
True if the provided Specification Version is supported
Type
boolean

(static) lt(specVersion, testVersion) → {boolean}

Description:
  • Test whether the provided Specification Version is smaller than the provided test version
Source:
Parameters:
Name Type Description
specVersion string Specification Version
testVersion string A Specification Version to compare the provided Specification Version to
Returns:
True if the provided Specification Version is smaller than the provided version
Type
boolean

(static) lte(specVersion, testVersion) → {boolean}

Description:
  • Test whether the provided Specification Version is smaller than or equal to the provided test version
Source:
Parameters:
Name Type Description
specVersion string Specification Version
testVersion string A Specification Version to compare the provided Specification Version to
Returns:
True if the provided Specification Version is smaller than or equal to the provided version
Type
boolean

(static) major(specVersion) → {integer}

Description:
  • Returns the major-version of the provided Specification Version
Source:
Parameters:
Name Type Description
specVersion string Specification Version
Returns:
Major version
Type
integer

(static) minor(specVersion) → {integer}

Description:
  • Returns the minor-version of the provided Specification Version
Source:
Parameters:
Name Type Description
specVersion string Specification Version
Returns:
Minor version
Type
integer

(static) neq(specVersion, testVersion) → {boolean}

Description:
  • Test whether the provided Specification Version is not equal to the provided test version
Source:
Parameters:
Name Type Description
specVersion string Specification Version
testVersion string A Specification Version to compare the provided Specification Version to
Returns:
True if the provided Specification Version is not equal to the provided version
Type
boolean

(static) satisfies(specVersion, range) → {boolean}

Description:
  • Test whether the provided Specification Version falls into the provided range
Source:
Parameters:
Name Type Description
specVersion string Specification Version
range string Semver-style version range, for example 2.2 - 2.4
Returns:
True if the provided Specification Version falls into the provided range
Type
boolean