// 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";

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

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