UNPKG

keep-a-changelog

Version:

Node package to parse and generate changelogs following the [keepachangelog](https://keepachangelog.com/) format.

32 lines (31 loc) 989 B
"use strict"; // Copyright 2018-2025 the Deno authors. MIT license. // This module is browser compatible. Object.defineProperty(exports, "__esModule", { value: true }); exports.greaterThan = greaterThan; const compare_js_1 = require("./compare.js"); /** * Greater than comparison for two SemVers. * * This is equal to `compare(version1, version2) > 0`. * * @example Usage * ```ts * import { parse, greaterThan } from "@std/semver"; * import { assert } from "@std/assert"; * * const version1 = parse("1.2.3"); * const version2 = parse("1.2.4"); * * assert(greaterThan(version2, version1)); * assert(!greaterThan(version1, version2)); * assert(!greaterThan(version1, version1)); * ``` * * @param version1 The first version to compare * @param version2 The second version to compare * @returns `true` if `version1` is greater than `version2`, `false` otherwise */ function greaterThan(version1, version2) { return (0, compare_js_1.compare)(version1, version2) > 0; }