Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecation(semver): deprecate Comparator functions #4131

Merged
merged 4 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions semver/comparator_format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { format } from "./format.ts";
* @example >=0.0.0
* @param comparator
* @returns A string representation of the comparator
*
* @deprecated (will be removed in 0.214.0) Use {@linkcode SemVerRange} instead of {@linkcode Comparator} and {@linkcode formatRange} for formatting it.
*/
export function comparatorFormat(comparator: Comparator): string {
const { semver, operator } = comparator;
Expand Down
2 changes: 2 additions & 0 deletions semver/comparator_intersects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { comparatorMax } from "./comparator_max.ts";
* @param c0 The left side comparator
* @param c1 The right side comparator
* @returns True if any part of the comparators intersect
*
* @deprecated (will be removed in 0.214.0) Use {@linkcode rangeIntersects} instead.
*/
export function comparatorIntersects(
c0: Comparator,
Expand Down
2 changes: 2 additions & 0 deletions semver/comparator_max.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { ANY, INVALID, MAX } from "./constants.ts";
* If an invalid comparator is given such as <0.0.0 then
* an out of range semver will be returned.
* @returns the version, the MAX version or the next smallest patch version
*
* @deprecated (will be removed in 0.214.0) Use {@linkcode rangeMax} instead.
*/
export function comparatorMax(semver: SemVer, operator: Operator): SemVer {
if (semver === ANY) {
Expand Down
2 changes: 2 additions & 0 deletions semver/comparator_min.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { increment } from "./increment.ts";
* @param semver The semantic version of the comparator
* @param operator The operator of the comparator
* @returns The minimum valid semantic version
*
* @deprecated (will be removed in 0.214.0) Use {@linkcode rangeMin} instead.
*/
export function comparatorMin(semver: SemVer, operator: Operator): SemVer {
if (semver === ANY) {
Expand Down
2 changes: 2 additions & 0 deletions semver/is_comparator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { ALL, NONE } from "./constants.ts";
* Adds a type assertion if true.
* @param value The value to check if its a Comparator
* @returns True if the object is a Comparator otherwise false
*
* @deprecated (will be removed in 0.214.0) Use {@linkcode isSemVerRange} instead.
*/
export function isComparator(value: unknown): value is Comparator {
if (
Expand Down
2 changes: 2 additions & 0 deletions semver/parse_comparator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type REGEXP_GROUPS = {
* Parses a comparator string into a valid Comparator.
* @param comparator
* @returns A valid Comparator
*
* @deprecated (will be removed in 0.214.0) Use {@linkcode parseRange} instead.
*/
export function parseComparator(comparator: string): Comparator {
const match = comparator.match(COMPARATOR_REGEXP);
Expand Down
3 changes: 2 additions & 1 deletion semver/test_comparator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { cmp } from "./cmp.ts";
* @param version The version to compare
* @param comparator The comparator
* @returns True if the version is within the comparators set otherwise false
* @deprecated (will be removed in 0.213.0) Use {@linkcode compare} instead.
*
* @deprecated (will be removed in 0.214.0) Use {@linkcode testRange} instead.
*/
export function testComparator(
version: SemVer,
Expand Down
2 changes: 2 additions & 0 deletions semver/try_parse_comparator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { parseComparator } from "./parse_comparator.ts";
* Parses a comparator string into a valid Comparator or returns undefined if not valid.
* @param comparator
* @returns A valid Comparator or undefined
*
* @deprecated (will be removed in 0.214.0) Use {@linkcode tryParseRange} instead.
*/
export function tryParseComparator(
comparator: string,
Expand Down