Skip to main content
Module

std/semver/mod.ts>compareBuild

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function compareBuild
Deprecated
Deprecated

(will be removed in 0.213.0) The build metadata should not be used for comparing versions. See https://semver.org/#spec-item-10 for details.

import { compareBuild } from "https://deno.land/std@0.211.0/semver/mod.ts";

Compare two semantic version objects including build metadata.

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(),

Returns

1 | 0 | -1