apps-script-utils 2.1.1 Help

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

currentVersion

string

The version in hand.

requiredVersion

string

The minimum that is acceptable.

message (optional)

string

The message of the exception. A default naming both versions is used when omitted.

Returns

string — the current version, unchanged.

Throws

Exception

Condition

IllegalArgumentException

the current version is lower than required.

Examples

Guarding a dependency

requireVersionCompatible("1.3.0", "1.2.0"); // => "1.3.0"

See also

Source

src/lang/string/requireVersionCompatible.ts

23 September 2026

This documentation was generated with AI (Claude) from the library's source code.