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

std/semver/rcompare.ts>rcompare

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function rcompare
import { rcompare } from "https://deno.land/std@0.195.0/semver/rcompare.ts";

A reverse comparison of two versions. Same as compare but 1 and -1 are inverted.

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

Returns

1 | 0 | -1

Parameters

s0: string | SemVer
s1: string | SemVer

Returns

1 | 0 | -1