Skip to content

@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: project/lib/specifications/SpecificationVersion.js, line 20

Parameters:
NameTypeDescription
specVersionstringSpecification 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: project/lib/specifications/SpecificationVersion.js, line 127

Parameters:
NameTypeDescription
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 83

Parameters:
NameTypeDescription
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 94

Parameters:
NameTypeDescription
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 105

Parameters:
NameTypeDescription
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 116

Parameters:
NameTypeDescription
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 50

Returns:

Major version

Type: integer

minor() → {integer}

Description: Returns the minor-version of the instance's Specification Version

Source: project/lib/specifications/SpecificationVersion.js, line 60

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: project/lib/specifications/SpecificationVersion.js, line 138

Parameters:
NameTypeDescription
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 72

Parameters:
NameTypeDescription
rangestringSemver-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: project/lib/specifications/SpecificationVersion.js, line 40

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: project/lib/specifications/SpecificationVersion.js, line 251

Parameters:
NameTypeDescription
specVersionstringSpecification Version
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 278

Parameters:
NameTypeDescription
rangestringSemver-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: project/lib/specifications/SpecificationVersion.js, line 199

Parameters:
NameTypeDescription
specVersionstringSpecification Version
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 212

Parameters:
NameTypeDescription
specVersionstringSpecification Version
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 149

Parameters:
NameTypeDescription
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 225

Parameters:
NameTypeDescription
specVersionstringSpecification Version
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 238

Parameters:
NameTypeDescription
specVersionstringSpecification Version
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 160

Parameters:
NameTypeDescription
specVersionstringSpecification Version
Returns:

Major version

Type: integer

(static) minor(specVersion) → {integer}

Description: Returns the minor-version of the provided Specification Version

Source: project/lib/specifications/SpecificationVersion.js, line 172

Parameters:
NameTypeDescription
specVersionstringSpecification 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: project/lib/specifications/SpecificationVersion.js, line 264

Parameters:
NameTypeDescription
specVersionstringSpecification Version
testVersionstringA 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: project/lib/specifications/SpecificationVersion.js, line 186

Parameters:
NameTypeDescription
specVersionstringSpecification Version
rangestringSemver-style version range,
for example 2.2 - 2.4
Returns:

True if the provided Specification Version falls into the provided range

Type: boolean