VersionSatisfiesRange (open)

Check if a semantic version matches the specified range


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

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


STRING version

Version to check

STRING semverrange

Semver range to check against

RECORD 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


True if 'version' qualifies