Skip to main content
Home
This release is 4 versions behind 1.0.5 — the latest version of @std/semver. Jump to latest

@std/semver@1.0.1
Built and signed on GitHub Actions

Parsing and comparing of semantic versions (SemVer)

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
9 months ago (1.0.1)
Package root>min_satisfying_test.ts
// Copyright Isaac Z. Schlueter and Contributors. All rights reserved. ISC license. // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assertEquals } from "jsr:@std/assert@^1.0.2"; import { parse } from "./parse.ts"; import { parseRange } from "./parse_range.ts"; import { minSatisfying } from "./min_satisfying.ts"; Deno.test("minSatisfying()", async (t) => { const versions: [string[], string, string][] = [ [["1.2.3", "1.2.4"], "1.2", "1.2.3"], [["1.2.4", "1.2.3"], "1.2", "1.2.3"], [["1.2.3", "1.2.4", "1.2.5", "1.2.6"], "~1.2.3", "1.2.3"], ]; for (const [v, r, e] of versions) { await t.step(r, () => { const s = v.map((v) => parse(v)); const range = parseRange(r); const expected = parse(e); const actual = minSatisfying(s, range); assertEquals(actual, expected); }); } });