IF Commons GitHub

logical/semver

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0004-repoctl-status-release FR-001

The order of versions (commons repoctl 0004-repoctl-status-release FR-001): the greatest of some versions of Semantic Versioning, by their numbers, a pre-release coming before the same numbers without one. Pure.

import { compareSemver, greatest } from "./semver.ts";
compareSemver("0.10.0", "0.9.9"); // 1
greatest(["1.0.0-rc.1", "1.0.0", "0.9.0"]); // "1.0.0"

Source: commons/repoctl/src/logical/semver.ts

2 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

logical.compareSemverfunctionno test imports it
function compareSemver(a: string, b: string): -1 | 0 | 1

-1, 0 or 1 as a is before, the same as, or after b; a text that is not a version is before every version.

logical.greatestfunctionno test imports it
function greatest(versions: readonly string[]): string | undefined

The greatest of some versions, or undefined where there are none.

compareSemverfunction
function compareSemver(a: string, b: string): -1 | 0 | 1

-1, 0 or 1 as a is before, the same as, or after b; a text that is not a version is before every version.

Imported by 14 tests of the run (14 passed, 0 failed): the library's results

greatestfunction
function greatest(versions: readonly string[]): string | undefined

The greatest of some versions, or undefined where there are none.

Imported by 14 tests of the run (14 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.