isVersionCompatible
function isVersionCompatible(currentVersion: string, requiredVersion: string): boolean;
versionCompare decides it, so the comparison is numeric group by group and 1.10 counts as above 1.2. Both arguments have to be plain dotted numbers; a pre-release suffix is rejected rather than ordered.
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The version in hand. |
|
| The minimum that is acceptable. |
Returns
boolean — true when the current version is the required one or higher.
Throws
Exception | Condition |
|---|---|
| either argument is not a valid version string. |
Examples
Checking a requirement
isVersionCompatible("1.3.0", "1.2.0"); // => true
isVersionCompatible("1.2.0", "1.3.0"); // => false
See also
Source
23 September 2026
This documentation was generated with AI (Claude) from the library's source code.