Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/molt/lib/std/semver.ts>compare

Update dependencies the Deno way
Latest
function compare
import { compare } from "https://deno.land/x/molt@0.17.2/lib/std/semver.ts";

Compare two semantic version objects.

Returns 0 if s0 === s1, or 1 if s0 is greater, or -1 if s1 is greater.

Sorts in ascending order if passed to Array.sort(),

Parameters

s0: SemVer
s1: SemVer

Returns

1 | 0 | -1