Module

std/semver/mod.ts>compare

Deno standard library
Go to Latest
function compare
import { compare } from "https://dotland.deno.dev/std@0.181.0/semver/mod.ts";

Returns 0 if v1 == v2, or 1 if v1 is greater, or -1 if v2 is greater. Sorts in ascending order if passed to Array.sort(),

Parameters

v1: string | SemVer
v2: string | SemVer
optional
options: Options

Returns

1 | 0 | -1