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

// denoCacheMetadata={"headers":{"access-control-allow-origin":"*","report-to":"{\"group\":\"cf-nel\",\"max_age\":604800,\"endpoints\":[{\"url\":\"https://a.nel.cloudflare.com/report/v4?s=gMEzlWJqUQw2V660oO8uK%2FZzy0lF37zCatithphfm8jA37qHsPmyFBLp1PnHrHNLgngdswo3ZG%2BKYHBK5yxlq3x1zJMkrTlJ83OKDlpanqFel2w2c5ddmmc%3D\"}]}","cache-control":"public, max-age=31536000, immutable","cf-ray":"a223e657ca9c7db6-LAX","access-control-expose-headers":"*","content-type":"text/typescript","cross-origin-resource-policy":"cross-origin","date":"Tue, 28 Jul 2026 12:31:15 GMT","cf-cache-status":"HIT","etag":"\"8e63543a7f2924e2c728cac3ad22548c\"","content-length":"876","vary":"Origin","x-jsr-backend":"modules","set-cookie":"__cf_bm=O99GGGp476EpOQB9y46OIDdDg1g28cVaPjswtlhotXI-1785241875.1735063-1.0.1.1-vZMqQp2q2WMUt7bx3ltESf.cswlCONjUnnEv6ZjiUzFFlOpQp8qtL_4bKi2iDrIIQUWTble_2vXmnmR0eh5eWxHA_Lh0a28qVYw9i3.7eYwONV1gwWcdzSI9HW1DDmsH; HttpOnly; SameSite=None; Secure; Path=/; Domain=jsr.io; Expires=Tue, 28 Jul 2026 13:01:15 GMT","x-robots-tag":"noindex","accept-ranges":"bytes","server":"cloudflare","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';","alt-svc":"h3=\":443\"; ma=86400","x-content-type-options":"nosniff","age":"3087495","nel":"{\"report_to\":\"cf-nel\",\"success_fraction\":0.0,\"max_age\":604800}"},"url":"https://jsr.io/@std/semver/0.224.3/greater_or_equal.ts","time":1785241875}