requireVersionCompatible
function requireVersionCompatible(
currentVersion: string,
requiredVersion: string,
message?: string
): string;
The assertion form. The default message names both versions, which is what makes an unmet dependency readable in an execution log.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The version in hand. |
|
| The minimum that is acceptable. |
|
| The message of the exception. A default naming both versions is used when omitted. |
Returns
string — the current version, unchanged.
Throws
Exception | Condition |
|---|---|
| the current version is lower than required. |
Examples
Guarding a dependency
requireVersionCompatible("1.3.0", "1.2.0"); // => "1.3.0"
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.