VersionSatisfiesRange (open)

Check if a semantic version matches the specified range

Syntax

LOADLIB "wh::util/semver.whlib";

BOOLEAN FUNCTION VersionSatisfiesRange(STRING version, STRING semverrange, RECORD options)

Parameters

STRING version

Version to check

STRING semverrange

Semver range to check against

RECORD options

Options

STRING comparemode

Comparison rules. If 'webhare' (the default), prerelease tags never match other prerelease tags for that version. If 'npm', prerelease tags are compared by token but a prerelease version can only satisfy if its major.minor.patch is mentioned in combination with any patchlevel in the semver range

Return value

BOOLEAN

True if 'version' qualifies