Skip to main content

core.compareversions

Home > @medplum/core > compareVersions

compareVersions() function

Compares two Medplum semver version strings, ignoring any trailing commit-hash suffix.

Signature:

export declare function compareVersions(a: MedplumSemver, b: MedplumSemver): number;

Parameters

Parameter

Type

Description

a

MedplumSemver

The first version to compare.

b

MedplumSemver

The second version to compare.

Returns:

number

A negative number if a is older than b, a positive number if a is newer than b, or 0 if they resolve to the same release.