function compare
compare(
a: string,
b: string
): number

Compares two x.y.z versions the way a release line orders them: negative when a is older, 0 when they are the same, positive when a is newer.

import * as Release from './release.ts';

Release.compare('0.34.5', '0.35.0') < 0; // true — 0.34.5 is the older one

Parameters

a: string
b: string

Return Type

number

Usage

import { compare } from "lib/commands/upgrade/release.ts";