Skip to content

Commit

Permalink
use SemVer consistently
Browse files Browse the repository at this point in the history
  • Loading branch information
kt3k committed May 27, 2024
1 parent 62fa0f9 commit 1501f17
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions semver/less_than_range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { isWildcardComparator } from "./_shared.ts";
import { compare } from "./compare.ts";

/**
* Check if the semver is less than the range.
* Check if the SemVer is less than the range.
*
* @example Usage
* ```ts
Expand All @@ -23,7 +23,7 @@ import { compare } from "./compare.ts";
*
* @param semver The version to check.
* @param range The range to check against.
* @returns `true` if the semver is less than the range, `false` otherwise.
* @returns `true` if the SemVer is less than the range, `false` otherwise.
*/
export function lessThanRange(semver: SemVer, range: Range): boolean {
return range.every((comparatorSet) =>
Expand All @@ -34,9 +34,9 @@ export function lessThanRange(semver: SemVer, range: Range): boolean {
function lessThanComparatorSet(semver: SemVer, comparatorSet: Comparator[]) {
// If the comparator set contains wildcard, then the semver is not greater than the range.
if (comparatorSet.some(isWildcardComparator)) return false;
// If the semver satisfies the comparator set, then it's not less than the range.
// If the SemVer satisfies the comparator set, then it's not less than the range.
if (testComparatorSet(semver, comparatorSet)) return false;
// If the semver is greater than any of the comparator set, then it's not less than the range.
// If the SemVer is greater than any of the comparator set, then it's not less than the range.
if (
comparatorSet.some((comparator) =>
greaterThanComparator(semver, comparator)
Expand Down
2 changes: 1 addition & 1 deletion semver/less_than_range_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
parseRange,
} from "./mod.ts";

Deno.test("lessThanRange() checks if the semver is less than the range", async (t) => {
Deno.test("lessThanRange() checks if the SemVer is less than the range", async (t) => {
// From https://github.com/npm/node-semver/blob/692451bd6f75b38a71a99f39da405c94a5954a22/test/fixtures/version-lt-range.js
const versionLtRange = [
["~1.2.2", "1.2.1"],
Expand Down
4 changes: 2 additions & 2 deletions semver/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
*
* Build metadata is `.` delimited alpha-numeric string.
* When parsing a version it is retained on the `build: string[]` field
* of the semver instance. When incrementing there is an additional parameter that
* can set the build metadata on the semver instance.
* of the SemVer instance. When incrementing there is an additional parameter that
* can set the build metadata on the SemVer instance.
*
* ### Advanced Range Syntax
*
Expand Down
2 changes: 1 addition & 1 deletion semver/range_intersects_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Deno.test({
["<=1.2.0", "<1.3.0", true],
["<1.2.0", "<=1.3.0", true],

// Different directions, same semver and inclusive operator
// Different directions, same SemVer and inclusive operator
[">=1.3.0", "<=1.3.0", true],
[">=v1.3.0", "<=1.3.0", true],
[">=1.3.0", ">=1.3.0", true],
Expand Down
2 changes: 1 addition & 1 deletion semver/range_max.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function comparatorMax(comparator: Comparator): SemVer {
* @returns A valid SemVer or INVALID
*
* @deprecated This will be removed in 1.0.0. Use {@linkcode greaterThanRange} or
* {@linkcode lessThanRange} for comparing ranges and semvers. The maximum
* {@linkcode lessThanRange} for comparing ranges and SemVers. The maximum
* version of a range is often not well defined, and therefore this API
* shouldn't be used. See
* {@link https://github.com/denoland/deno_std/issues/4365} for details.
Expand Down
2 changes: 1 addition & 1 deletion semver/range_min.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function comparatorMin(comparator: Comparator): SemVer {
* @returns A valid SemVer or INVALID
*
* @deprecated This will be removed in 1.0.0. Use {@linkcode greaterThanRange} or
* {@linkcode lessThanRange} for comparing ranges and semvers. The minimum
* {@linkcode lessThanRange} for comparing ranges and SemVers. The minimum
* version of a range is often not well defined, and therefore this API
* shouldn't be used. See
* {@link https://github.com/denoland/deno_std/issues/4365} for details.
Expand Down

0 comments on commit 1501f17

Please sign in to comment.