// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

import type { SemVer } from "./types.ts";
import { compare } from "./compare.ts";

/**
 * Greater than comparison
 *
 * This is equal to `compare(s0, s1) > 0`.
 *
 * @example Usage
 * ```ts
 * import { parse, greaterThan } from "@std/semver";
 * import { assert, assertFalse } from "@std/assert";
 *
 * const s0 = parse("1.2.3");
 * const s1 = parse("1.2.4");
 * assert(greaterThan(s1, s0));
 * assertFalse(greaterThan(s0, s1));
 * assertFalse(greaterThan(s0, s0));
 * ```
 *
 * @param s0 The first version to compare
 * @param s1 The second version to compare
 * @returns `true` if `s0` is greater than `s1`, `false` otherwise
 */
export function greaterThan(s0: SemVer, s1: SemVer): boolean {
  return compare(s0, s1) > 0;
}

// denoCacheMetadata={"headers":{"content-security-policy":"default-src 'none'; script-src 'none'; style-src 'none'; img-src 'none'; font-src 'none'; connect-src 'none'; frame-src 'none'; object-src 'none'; frame-ancestors 'none'; sandbox; form-action 'none';","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}","cf-cache-status":"HIT","content-length":"841","alt-svc":"h3=\":443\"; ma=86400","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=eqqGkGFFgx6S6%2FraDHb5LJy%2BRiQ5X%2FoS%2BJfd8tCxuMi6IbiEVTpIZhsHj8P4DfGrjv%2B0bOgppotC%2BuaHxOPuuNC1%2FGIqoLktYWygYLZwGj4U%2FNVkHqdXGXY%3D\"}]}","vary":"Origin","x-jsr-backend":"modules","access-control-expose-headers":"*","etag":"\"a04ccdb87069cebe87a9494d9618d106\"","x-content-type-options":"nosniff","cf-ray":"a223e657ca997db6-LAX","access-control-allow-origin":"*","x-robots-tag":"noindex","accept-ranges":"bytes","set-cookie":"__cf_bm=WH8RyqMjkNgd50FrFjv.O5vFXeJ_qP13umLE70ji7bs-1785241875.1729236-1.0.1.1-02NvQVi5NORwLezLsnHy4rmVjjb7amLigqWQV_ifbWperw9E6BcMmWI4Jae0EHW300fyLr3U.XmrXCh3JUoxOhz0ADoV0Q6hKSupyG.uzu5hiel5bQz0JQ2M2ON8Ugpi; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","cache-control":"public, max-age=31536000, immutable","content-type":"text/typescript","server":"cloudflare","age":"1336394","cross-origin-resource-policy":"cross-origin","date":"Tue, 28 Jul 2026 12:31:15 GMT"},"url":"https://jsr.io/@std/semver/0.224.3/greater_than.ts","time":1785241875}