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

std/semver/mod.ts>cmp

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

Do a comparison of two semantic version objects based on the given operator

Parameters

s0: SemVer

The left side of the comparison

operator: Operator

The operator to use for the comparison

s1: SemVer

The right side of the comparison

Returns

boolean

True or false based on the operator

Parameters

s0: string | SemVer
operator: Operator
s1: string | SemVer
optional
options: { includePrerelease: boolean; }

Returns

boolean